> I am trying to do some (what I think is) advanced routing. So my
> goal is to have a person be able to type inhttp://example.com/users/bobcostas
> and then have cakePHP automatically redirect to that bob costas'
> profile page if if it exists.
This is trivial routing ;-)
There are many ways to achieve that, in one of my applications I use
the approach to create the routes for elements every time a db is
updated, but in most cases that would be an overkill.
So you need to insert in your routes.php something alike:
Router::connect('/users/*', array('controller' => 'users', 'action' =>
'view');
and the * part will be mapped to the first parameter in your
UsersController::view() method.
HTH,
Piotr
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment