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'])
Edit: I could create an action for each different type and use setAction to use the view action instead. Although is there a better way to do this?
array('controller' => 'posts', 'action' => 'featured', $post['Post']['slug'])
function featured($slug) {
$this->setAction('view', $slug);
}