On Thu, Jun 12, 2008 at 12:52 PM, mwcbrent <[EMAIL PROTECTED]> wrote:
> I'm looking to setup a system that will do rewrites, this is
> similar to myspace or other sites that allow you to setup a page and
> change the url to something personalized.
> www.mysite.com/user/232434
> to
> www.mysite.com/user/myhomepage
Reusing /user/* for both IDs and custom labels is going to be a pain.
I'd recommend coming up with something different for the /user/ part
to more readily differentiate between the two structures. For example:
Router::connect('/person/:label', array('controller'=>'users',
'action'=>'bylabel'), array('label'=>'.*')); (or something like that)
function bylabel(){
$user = $this->User->findByLabel($this->params['label']);
[...other code here...]
}
That's a pretty rough idea.
> Is there a way to get the routing system to check the database? Or
> should i just not even use the routing system and query the db with
> 'myhomepage' instead of the user id passed in the url?
>
> Thanks for the feedback.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---