public function sidebarBoxAction() { $items = (int) $this->getParam("items"); if (!$items) { $items = 3; } // this is the alternative way of getting a list of objects $blogList = Object\BlogArticle::getList(["limit" => $items, "order" => "DESC", "orderKey" => "date"]); $this->view->articles = $blogList; }
public function detailAction() { $this->enableLayout(); $article = Object\BlogArticle::getById($this->getParam("id")); if (!$article instanceof Object\BlogArticle || !$article->isPublished()) { throw new \Zend_Controller_Router_Exception("invalid request"); } $this->view->article = $article; $categories = Object\BlogCategory::getList(); $this->view->categories = $categories; }