I have been trying to do the following method to create urls like:
domain.com/portfolio/This_is_a_test_post
function view ( $title )
{
I would recommend using the ID for addressing content on your website, this way you do not have to worry about dealing with title/slug changes. For a SEO perspective you can easily use the Slug without doing anything with it technically:
function view($id) {
$this->Post->id = $id;
$this->set('post',$this->Post->read());
}
And in your view, create links like this:
$this->Html->link('name of the link', array('controller' => 'posts', 'action' => 'view', $post['Post']['id'], Inflector::slug($post['Post']['title'])));
Now your URL's will look like this:
domain.com/posts/13/This_is_a_test_post
Note that the slug isn't doing anything, but is giving you the benefit of SEO