public function renderForm($id = NULL) { $newCategory = TRUE; if ($id) { /** @var Form $form */ $form = $this['brandForm']; $brand = $this->brandManager->getById($id); $form->setDefaults(['brand_id' => $brand['id'], 'title' => $brand['title']]); $newCategory = FALSE; } $this->template->newCategory = $newCategory; }