search
top

Fancy URLs with Inflector::slug

Motivated by my recent tweet i thought i share my method of replacing the old SluggableBehavior with core functions. Sometimes we have more than one model that uses slugs. For example: Tags, Posts, Categories. That’s why i add the following to AppModel which allows me to call it on any model. function slugify($text) { return low(Inflector::slug($text, '-')); } But because i am lazy i just use one of... read more
 Page 2 of 2 « 1  2 
top