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(); }
/** * @return Article[] */ public function getAllArticles() { return $this->articleRepository->findAll(); }