Hi there,
The application im currently working on allows Users and Groups to
select their unique personalized URLs i.e. www.site.com/my_own_url. I
have specified the routes like so:
$Route->connect('/:user_url', array('controller' => 'users', 'action'
=> 'view', 'url' => ':user_url'), array('user_url' => '[\w]+'));
$Route->connect('/:group_url', array('controller' => 'groups',
'action' => 'view', 'url' => ':group_url'), array('group_url' => '[\w]
+'));
The beforeFilter() method in the Users controller first checks if
there is user with that URL, otherwise it will be passed on to the
Groups controller. So in the Users controller's beforeFilter() method
I have:
function beforeFilter() {
If user with URL exists -> display view() page
Else hand it to the Groups controller ($this->redirect('/' . $this-
>params['user_url']))
}
The problem I'm having is a redirect loop. Of course the first route
will always catch whatever it is. If I could somehow select which
route to activate.. and I don't have the luxury of adding prefixes to
the URL.. Thanks for all your help!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---