To use it, just place the behavior file on the proper place (/app/models/behaviors/)and call it on the model you want to “slugify”:
|
To use it, just place the behavior file on the proper place and call it on the model you want to “slugify”: var $actsAs = array(‘Sluggable’); By default, this will automatically create slugs from a field named “title” and place it under a field named “slug”. If you want, you can customize everything. Checkout the configuration keys:
var $actsAs = array(
'Sluggable' => array(
'fields' => 'title',
'scope' => false,
'conditions' => false,
'slugfield' => 'slug',
'separator' => '-',
'overwrite' => false,
'length' => 256,
'lower' => true
)
);
No comments:
Post a Comment