using slugs (cakedc utils plugin sluggable or cake syrup)
http://bakery.cakephp.org/articles/mariano/2007/03/24/sluggable-behavior
and in routes
App::import('Lib', 'routes/UserRoute');
Router::connect('/:slug', array(
'controller' => 'users',
'action' => 'view'),
array('routeClass' => 'UserRoute'));
you could specify the form the slug must be there too
see the section Passing parameters to action in the cake book
http://book.cakephp.org/view/945/Routes-Configuration#Passing-parameters-to-action-949
adapt the advice on Mark Story routing class
http://mark-story.com/posts/view/using-custom-route-classes-in-cakephp
hth - S
On 19 April 2011 00:02, MeatSandwich <[email protected]> wrote:
> I'm trying to create an app which allows a user to create an account
> and then create their own page.
>
> I'd like to use a combination of the users first and and last name as
> the url of their page, ie mywebsite.com/john_smith
>
> Obviously I'd need to create a controller with an apropriate action,
> but how do I go about making it have the url I want?
>
> By the way, I've read through the manual a bunch of times (all the
> stuff about routes esp) and read loads of tutorials and a couple of
> the books but there's nothing I've come across that explains this
> exactly.
>
> any help would be greatly appreciated.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group
> at http://groups.google.com/group/cake-php
>
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php