You can set your routes up like this, and it should automatically send
username in your $this->params array.

Router::connect('/:username/:controller/:action/*',
array('useraccount' => 1));

But this means (AFAIK) you need to manually connect the rest of your
controllers, otherwise cake won't be able to tell the different
between a useraccount request and a normal controller request.

Router::connect('/users/:action/*', array('controller' => 'users'));

I'm not 100% positive on this, but I would put the hardcoded routes
for your normal controllers above the :username one. Also, looking
back at this, maybe another way to separate user functionality from
normal site functionality (if they are not meant to be mixed) is to
make a useraccounts plugin and forward the requests to that using
routes.

Anyway who has done anything like this please correct me if I am
talking shit.

Cheers,
Adam


On Dec 25, 7:51 am, "Tom.Maiaroto" <[EMAIL PROTECTED]> wrote:
> ok... so i'm thinking you can't put something before /:controller/ in
> the routing?
> am i correct?
>
> i gave this a shot:
>
> Router::connect('/:controller/:userid/', array('action' => 'index',
> 'userid' => 'null'), array('userid' => '.*'));
>
> so i can type in abc.com/posts/usernameajkfdsk/  and get posts/index/
> i'm assuming a param of "usernameajk whatever the hell i just
> scribbled" gets passed then too.
>
> maybe i did something wrong..
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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