Set all of your other routes first, including routes that would normally be set by default (like /someController/someAction/), because you're going to be overriding EVERYTHING by doing this.
After all the other routes, set:
$Route->connect('/:articletitle/', array('controller' => 'articles', 'action' => 'view'));
In the view method of the article controller, you can access the $this->params['articletitle'] variable to see the title.
Have fun,
Eric
On 10/2/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Im trying to get my head around how Routes work, currently i have the
following URL
/posts/view/1 which i wish to be formatted as so /post-title/
How do i go about adding this custom route?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" 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
-~----------~----~----~----~------~----~------~--~---
- Simple Routes Question [EMAIL PROTECTED]
- Re: Simple Routes Question Eric C Blount
