Hello,

I have navigation in site where url looks like www.sitename.com/:lang/:slug
is there any way to define almost same pattern for different
controllers? Now for example if i want to define route to services
controller and must manually enter route to it.

Router::connect("/:language/paslaugos",array('controller' =>
'services', 'action' => 'view'),array('language' => '[a-zA-Z]{2}'));
Router::connect("/:language/services",array('controller' =>
'services', 'action' => 'view'),array('language' => '[a-zA-Z]{2}'));
 Router::connect("/:language/uslugi",array('controller' => 'services',
'action' => 'view'),array('language' => '[a-zA-Z]{2}'));

It is ok ar works fine but how define it dynamically, for example user
can change slug.
If i define route

Router::connect("/:language/:slug",array('controller' => 'services',
'action' => 'view'),array('language' => '[a-zA-Z]{2}'));

but it always points to same location services controller, and i need
same pattern (/:language/:slug) in other controllers.

I know i can do simple prefixing

Router::connect("/services/:language/:slug",array('controller' =>
'services', 'action' => 'view'),array('language' => '[a-zA-Z]{2}'));

but it is inappropriate for me. Well i could make model for routes
where i can store slug values, and user may change it but in that
level i dont know how to change route if it possible at all.

What i want to achive that my site urls looks like (/en/servises, /ru/
uslugi)  (/en/news/, /ru/novosti/) and each pointing to diferent
controller and possible user to change slug.

Is there any way to dynamically define same routing pattern to
different controllers?

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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to