Skip to content

Instantly share code, notes, and snippets.

@lucasff
Created July 15, 2014 22:07
Show Gist options
  • Select an option

  • Save lucasff/734762bcea1cecc7b679 to your computer and use it in GitHub Desktop.

Select an option

Save lucasff/734762bcea1cecc7b679 to your computer and use it in GitHub Desktop.
Fix for Pagination
<?php
// carregaMenuSite() antes do $categoria_route
if (in_array('index', $this->params['pass'])) {
unset($this->params['pass'][array_search('index', $this->params['pass'])]);
$this->params['pass'] = array_merge($this->params['pass']);
}
<?php
// qualquer lugar antes da chamada do Paginador
$args = $this->passedArgs;
if (isset($args[1]) && $args[0] == 'index') {
$args[0] = $args[1];
unset($args[1]);
}
$this->Paginator->options(array(
'url' => $args
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment