Beispiel #1
0
 /**
  * List all comments.
  *
  * @return void
  */
 public function viewAction($pageKey = null, $redirect = '')
 {
     $this->initialize();
     $all = $this->comments->findAll($pageKey);
     $this->theme->setTitle("Kommentarer");
     $this->views->add('comment/comments', ['comments' => $all, 'pageKey' => $pageKey, 'redirect' => 'comments', 'controller' => 'comments']);
     $form = new \Anax\HTMLForm\CFormCommentAdd($pageKey, $redirect);
     $form->setDI($this->di);
     $status = $form->check();
     $this->views->add('comment/form', ['title' => "Lägg till en kommentar", 'content' => $form->getHTML()], 'main');
 }