php - Zend paginator - is it possible to set custom params? -


i taking care of legacy zend project. there table populated values using paginator:

paginator = zend_paginator::factory( $this->_getrecords($filter1, $filter2)   );  $paginator->setcurrentpagenumber($this->_getparam('page')); $this->view->paginator = $paginator; 

now here issue. paginator not know filters ( filter1 , filter2 ).

clicking on page results in empty filter1 , filter2 values. want set filters params in paginator, smthing like:

/admin/users/index/page/7/filter1/value1/filter2/value2

then able say:

paginator = zend_paginator::factory( $this->_getrecords($this->_getparam('filter1'), $this->_getparam('filter2'))   ); 

is possible ?

paginator doesn't generate urls. urls generated router.

transmit filters template current page

$this->view->paginator = $paginator; $this->view->filters = array('filter1'=>$filter1, 'filter2'=>$filter2); 

in template current page transmit filters paginator template

<?php echo $this->paginationcontrol($this->paginator, 'sliding', 'pagination.tpl', array('filters'=>$this->filters)); ?> 

in paginator template 'pagination.tpl' add them url generation function

<a href="<?php echo $this->url($this->filters + array('page'=>($this->current-1))); ?>">prev</a>  <a href="<?php echo $this->url($this->filters + array('page'=>($this->current+1))); ?>">next</a> 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -