Exemple #1
0
 public function listAction()
 {
     $model = new Cars();
     $page = $this->request->getParam('page', 1);
     $limit = 3;
     $from = ($page - 1) * $limit;
     $this->view->pagerConfig = array('url' => Url::getUrl('car', 'list', array('page' => 'key_page')), 'count' => $model->carCount(), 'pack' => $limit, 'page' => $page);
     $this->view->data = $model->getCarsWithLimit($from, $limit);
     $this->view->display('list');
 }
Exemple #2
0
 public function listAction()
 {
     $id = $this->request->getParam('id_edycja');
     $this->view->id_edycja = $id;
     $Cars = new Cars();
     $page = $this->request->getParam('page', 1);
     $limit = 10;
     $from = ($page - 1) * $limit;
     $this->view->pagerConfig = array('url' => Url::getUrl('auta', 'list', array('page' => 'key_page')), 'count' => $Cars->carCount($this->request->getParam('id_marki')), 'pack' => $limit, 'page' => $page);
     if (!empty($this->request->getParam('id_marki'))) {
         $this->view->pagerConfig['url'] = Url::getUrl('auta', 'list', array('page' => 'key_page', 'id_marki' => $this->request->getParam('id_marki')));
     }
     $this->view->data = !empty($this->request->getParam('id_marki')) ? $Cars->getData($from, $limit, $this->request->getParam('id_marki')) : $Cars->getData($from, $limit);
     $this->view->id_marki = $this->request->getParam('id_marki');
     $this->view->display('auta');
 }