[Solved] Cakephp routing (in PHP too) [closed]


As indicated in the docs, you can use regular expressions to restrict matching route elements. The regex snippet you are looking for is:

'(?i:hellouser)' 

Route definition

Putting the docs and your specific regex together, here’s a route that will match the url /hellouser in a case insensitive manner:

Router::connect(
    '/:user', 
    array('controller' => 'teachers', 'action' => 'contentProfile', 1),
    array('user' => '(?i:hellouser)')
);

The third argument is used to restrict the possible values of route elements – in this case to “hellouser” in a case insensitive manner.

7

solved Cakephp routing (in PHP too) [closed]