1
Router::connect('/(?i:about)', array('controller' => 'pages', 'action'=>'display', 'about'));

used to work in CakePHP 1.2 but it seems to not be working in CakePHP 2.x

The only other solution that I see is to use the options to set a regular expression that will match against the a flag in the rout, but it seems rather convoluted for something so simple:

Router::connect('/:aboutFlag', array('controller' => 'pages', 'action'=>'display', 'about'),array("aboutFlag"=>"[aA]bout"));

Is there an easier solution more akin to how it was done in cake 1.2?

tomwoods
  • 1,125
  • 1
  • 12
  • 19
  • Related [question](http://stackoverflow.com/questions/9105941/case-insensitive-routing-in-cakephp). – user9440008 Jul 27 '12 at 20:08
  • Thanks. I had already searched stack overflow too, and seen that response. Notice my question is if there is an easier way, creating a custom routing class is classified under *harder* :) – tomwoods Jul 27 '12 at 20:29
  • The answer I finally got to this question too is here, fyi: http://stackoverflow.com/questions/12526099/cakephp-routing-in-php-too – cdub Sep 21 '12 at 09:21
  • Thanks, I've added a pull request in the Cake documentation describing the answer you received: https://github.com/cakephp/docs/pull/390/commits – tomwoods Sep 21 '12 at 17:41

1 Answers1

0
Router::connect('/:aboutFlag', array('controller' => 'pages', 'action'=>'display', 'about'),array("aboutFlag"=>"(?i:about)"));

This stems from the answer posted here

Community
  • 1
  • 1
tomwoods
  • 1,125
  • 1
  • 12
  • 19