예제 #1
0
 public function actionDefault($articleId = NULL)
 {
     if ($articleId !== NULL) {
         $this->authorize();
         $this->article = $this->articles->getByID($articleId);
         $this->checkRecord($this->article);
         $this['articleForm']->setDefaults(['title' => $this->article->getTitle(), 'content' => $this->article->getContent()]);
     }
     $this->template->articles = $this->articles->findAll();
 }
예제 #2
0
 /**
  * @return Article[]
  */
 public function getAllArticles()
 {
     return $this->articleRepository->findAll();
 }