Example #1
0
 /**
  * Index action method
  *
  * @return void
  */
 public function index()
 {
     $role = new Model\Role();
     if ($role->hasPages($this->application->config()['pagination'])) {
         $limit = $this->application->config()['pagination'];
         $pages = new Paginator($role->getCount(), $limit);
         $pages->useInput(true);
     } else {
         $limit = null;
         $pages = null;
     }
     $this->prepareView('roles/index.phtml');
     $this->view->title = 'Roles';
     $this->view->pages = $pages;
     $this->view->queryString = $this->getQueryString('sort');
     $this->view->roles = $role->getAll($limit, $this->request->getQuery('page'), $this->request->getQuery('sort'));
     $this->send();
 }