How to set Cakephp paginator url for custom Route

I was making a url route like this:

[php]Router::connect(‘/ca/assets’, array(‘plugin’ => ‘file_manager’, ‘controller’ => ‘file_manager’, ‘action’ => ‘assets’, ‘ca’));[/php]

It worked alright with normal urls as- /ca/assets. However when i used paginator in view as

[php]echo $this->Paginator->numbers();[/php]

it generates url as- /assets/ca/page:2

I tried different things and at the end, as a work around to this problem I figured out that the following trick works. So make some heck in the $this->Paginator->options() function as the following:

[php]$this->Paginator->options(array(
‘url’=>array(‘controller’ => ‘ca’, ‘controller’=>’action’, ‘plugin’=>false)
));[/php]

Leave a Reply