2010/8/30 Harald Martin Bråttbåkk <wynksaiddest...@googlemail.com>:
> Hello,
>
> i simply want to change the default routing pattern "http://
> example.com/controller/action/param1/param2/param3" into "http://
> example.com/param1/controller/action/param2/param3". Is there a simple
> way to do this?

I'm not sure about doing it with generic controller and action. Also,
the regular expressions necessary will depend on what the params are
expected to be. For example, if you wanted URLs like so:

http://www.whatever.com/en/catalogs/some_string123/456

Router::connect(
        '/:param1/catalogs/:param2/:param3',
        array(
                'controller' => 'catalogs',
                'action' => 'view'
        ),
        array(
                'param1' => '[a-z]{2}',
                'param2' => '[_a-z0-9]+',
                'param3' => '[0-9]+'
                'pass' => array(
                        'param1', 'param2', 'param3'
                )
        )
);

function view($param1, $param2, $param3) { ... }

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to