Posted By

sveggiani on 09/03/10


Tagged

cakephp


Versions (?)

Cakephp: preserve custom routes parameters in paginator links


 / Published in: PHP
 

  1. // EXAMPLE ROUTE DEFINITION
  2. Router::connect('/:microsite/sitios/*', array('controller' => 'sites', 'action' => 'index'), array('microsite' => '[a-zA-Z0-9\-]+'));
  3.  
  4. // VIEW CODE
  5. $paginator->options( array( 'url' => array_merge( array('microsite' => $_microsite['permalink'] ), $this->passedArgs) ) );
  6.  
  7. $paginator->hasPrev() ) echo '<li>'.$paginator->prev('« Sitios anteriores', array('escape' => false)).'</li>';
  8.  
  9. $paginator->hasNext() ) echo '<li>'.$paginator->next('Sitios recientes »', array('escape' => false)).'</li>';

Report this snippet  

You need to login to post a comment.