Reputation: 28793
I have the following link: <?php echo $this->Html->link($post['Portfolio']['title'],
array('controller' => 'portfolio', 'action' => 'view', Tiny::toTiny($post['Portfolio']['id']), Inflector::slug($post['Portfolio']['title'])),
array('title' => $post['Portfolio']['title'])); ?>
which creates urls like http://driz.co.uk/portfolio/view/3z/Paperview_Magazine
BUT I want to remove the view
part of the url via the routing system. So far I have implemented this:
Router::connect('/portfolio/id:/slug:', array('controller' => 'portfolio', 'action' => 'view', 'id', 'slug'));
But it doesn't work. Can anyone help?
Upvotes: 1
Views: 92
Reputation: 24969
You should try this:
Router::connect('/portfolio/*', array('controller' => 'portfolio', 'action' => 'view'));
Upvotes: 1