Exemplo n.º 1
0
 /**
  * @param int $id
  *
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException
  */
 public function execute($id)
 {
     $category = $this->categoriesModel->getOneById($id);
     if (empty($category) === false) {
         $this->title->setPageTitlePostfix($category['title']);
         if ($this->request->getPost()->count() !== 0) {
             return $this->executePost($this->request->getPost()->all(), $category, $id);
         }
         return ['form' => array_merge($category, $this->request->getPost()->all()), 'form_token' => $this->formTokenHelper->renderFormToken()];
     }
     throw new Core\Controller\Exception\ResultNotExistsException();
 }