Пример #1
0
 /**
  * @param int $id
  *
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException
  */
 public function execute($id)
 {
     $comment = $this->commentsModel->getOneById($id);
     if (empty($comment) === false) {
         $this->breadcrumb->append($this->translator->t($comment['module'], $comment['module']), 'acp/comments/details/index/id_' . $comment['module_id'])->append($this->translator->t('comments', 'admin_details_edit'));
         $this->title->setPageTitlePostfix($comment['name']);
         if ($this->request->getPost()->count() !== 0) {
             return $this->executePost($this->request->getPost()->all(), $comment, $id, $comment['module_id']);
         }
         return ['form' => array_merge($comment, $this->request->getPost()->all()), 'module_id' => (int) $comment['module_id'], 'form_token' => $this->formTokenHelper->renderFormToken(), 'can_use_emoticons' => true];
     }
     throw new Core\Controller\Exception\ResultNotExistsException();
 }