Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 /**
  * 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());
 }