Reputation: 1987
I am using this for slugging:
<?php echo $this->Html->Link(__('more'), '/l/'. Inflector::slug($data['Object']['region']) .'/'. Inflector::slug($data['Object']['cat']) .'/'. Inflector::slug($data['Object']['title']) .'/'. $data['Object']['id'], array('class' => 'regular_btn'));?>
to get nice SEO friendly links. Works fine so far, the result looks like
.../l/reg/cat/Postmodern_luxury_residence_close_to_Real_Bendinat_golf_course/123
I just wished that the _ could be a - instead? Is that possible to change?
Thanks!!
Upvotes: 0
Views: 159
Reputation: 9398
it should be simply
Inflector::slug($data['Object']['region'], '-')
http://api.cakephp.org/2.5/class-Inflector.html#_slug
Upvotes: 1