0

I have default routing rule set:

Router::connect('/', array('controller' => 'photos', 'action' => 'index'));

when i go to

http://url.com/photos/index/page:1/limit:10/direction:desc/ 

everything works fine but it breaks when i go to

http://url.com/page:1/limit:10/direction:desc/
okwme
  • 740
  • 1
  • 7
  • 19

1 Answers1

0

First, you need to tell your route to parse after the /:

Router::connect('/*', array('controller' => 'photos', 'action' => 'index'));

Then, connect the named parameters:

Router::connectNamed(false, array('defaults' => true));

You can also set them within your route, if you prefer. More information on connecting named parameters here: http://book.cakephp.org/2.0/en/development/routing.html#controlling-named-parameters

jeremyharris
  • 7,884
  • 22
  • 31