예제 #1
0
 public function indexAction()
 {
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'id');
     $order = $request->getParam('order', 'asc');
     $announcementModel = new Announcement();
     $select = $announcementModel->select()->where('ghost = false');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('created_at', 'title', 'created_by', 'valid_since', 'valid_until', 'id_branch');
 }