コード例 #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();
 }