コード例 #1
0
ファイル: ArticleController.php プロジェクト: bb-drummer/Zcmf
 public function viewAction()
 {
     $id = $this->getParam('id', 0);
     $article = $this->service->setBlog($this->page->getModuleId())->getArticle($id);
     if (null === $article) {
         throw new DomainException('Article not found', 404);
     }
     return array('article' => $article);
 }
コード例 #2
0
ファイル: ArchiveController.php プロジェクト: bb-drummer/Zcmf
 /**
  * Render content page
  */
 public function indexAction()
 {
     $offset = $this->getParam('offset', 0);
     $articles = $this->service->setBlog($this->page->getModuleId())->getPaginatedArticles($offset, $this->itemsPerPage);
     return array('articles' => $articles, 'current_route' => $this->getMatchedRouteName());
 }