示例#1
0
 public function indexAction()
 {
     $limit = $this->request->getQuery('limit', 'string', 6);
     if ($limit != 'all') {
         $paginatorLimit = (int) $limit;
     } else {
         $paginatorLimit = 9999;
     }
     $page = $this->request->getQuery('page', 'int', 1);
     $projects = Project::find(array("visible = 1", array("order" => "sortorder DESC")));
     $paginator = new \Phalcon\Paginator\Adapter\Model(array("data" => $projects, "limit" => $paginatorLimit, "page" => $page));
     $this->view->paginate = $paginator->getPaginate();
     $this->helper->title()->append('Галерея проектов');
     $this->view->navigationActive = 'projects';
     $this->view->limit = $limit;
 }
示例#2
0
 public function initialize()
 {
     $this->view->setMainView(MAIN_VIEW_PATH . 'admin');
     $this->helper->activeMenu()->setActive('admin-projects');
     $this->view->entries = Project::find(array('order' => 'sortorder DESC'));
 }