Monday, August 30, 2010

Re: Need help from a routing "expert"

arghh... told you it'd be easy... thanks for that :)


On Mon, Aug 30, 2010 at 10:35 PM, Andy Dirnberger <andy.dirnberger@gmail.com> wrote:
Router::connect('/threads/*', array('controller' => 'threads',
'action' => 'index'));

On Aug 30, 7:52 am, Greg Skerman <gsker...@gmail.com> wrote:
> Ok so this should be fairly easy right?
>
> I have a few controllers (forums, threads and posts)
>
> The index of the forums controller shows the list of available forums
> The index of the threads controller shows the list of threads for a forum
> (so an ID is passed to the index method)
> The index of the posts controller shows the list of posts within a thread
> (so a forumID and a threadID is passed to the index method).
>
> So my URL's look somewhat aweful....i have /threads/index/1 etc
>
> what i'd really like is /threads/1
>
> so i tried Router::connect('/threads/:id', array('controller' => 'threads',
> 'action' => 'index'); to no avail... i tried playing with named arguments
> (which I would prefer to avoid) and still no luck.
>
> Surely it can't be hard to route out the action......help?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: