0
votes

Is it possible to define a custom URL for CakePHP pagination url?

I need something like /:slug/:slug2/:slug3/. How should I provide this url to pagination?

Thanks!!

P.S. If I'm using this, CakePHP defines controller and view automatically in the URL and result is /controller/action/something/ - I need to disable controller and action in url.

$this->Paginator->options(array(
    'url' => '/something/'
));
2

2 Answers

2
votes

Use routing. http://book.cakephp.org/2.0/en/development/routing.html

You should not use string type URLs for "internal" links because they won't work the routing and your links wont work any more in the case the app is in subdirectory of the webroot.

2
votes

in your view:

$this->Paginator->options(array('url' => $this->passedArgs));

Will add arguments passed to your pagination links.