public function editAction()
 {
     $this->userService->checkRightGate('CONTENT_EDIT');
     $form = $this->formManager->initForm('catEditForm', dirname(__FILE__) . '/categoryForm.xml');
     if ($form->isSubmit()) {
         if ($form->isValid()) {
             $cat = $form->getContainer('category');
             $this->categoryService->save($cat);
             $this->forward('content', 'category', 'index', array('idCat' => $cat->id));
             return;
         }
     } else {
         $id = $this->getParam('idCat', 0);
         if ($id == '') {
             $this->goHome();
             return;
         }
         $cat = $this->categoryService->get($id);
         if ($cat == null) {
             $this->goHome();
             return;
         }
         $form->setContainer('category', $cat);
     }
     $this->formManager->storeForm($form);
     $this->assign('form', $form);
     $this->assign('category', $cat);
 }