Routing to a different URLs based on post type

Posted by DanCake on Stack Overflow See other posts from Stack Overflow or by DanCake
Published on 2010-03-19T07:38:29Z Indexed on 2010/03/19 7:41 UTC
Read the original article Hit count: 183

Filed under:
|
|

What would be the best way to set up my routes so different types of posts have different URLs?

For example, regular posts are /posts/slug while featured posts are /featured/slug

Both link to the same controller and action /posts/view/slug.

I experimented with different ways of doing this but with little success. Currently my link params look something like the following:

array('controller' => 'posts', 'action' => 'view', 'featured' ,$post['Post']['slug'])

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about php