Inheritance: extends Concrete
コード例 #1
0
 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;
 }
コード例 #2
0
 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;
 }