/** * @param CategoryForm $form */ public function formSubmitted(CategoryForm $form) { try { $this->categoryManager->update($form->getValues()); $form->presenter->flashMessage('Category management was successful', 'success'); } catch (\Nette\InvalidArgumentException $ex) { $form->addError($ex->getMessage()); } }