Currently Browsing: CakePHP Hints
Jan 25, 2009
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
Dec 25, 2008
CakePHP Migrations: INTEGER gotchas
Okay.. today i played around with the wonderful migrations implementation from Joel Moss and found some stuff in regard of typing in YAML. First of all: It’s a pain in the ass – Secondly: It’s a breeze when it’s done. Some beginners, just like me, may have wondered about why your generated schema does not reflect the exact layout after doing “migrate up” with the exact... read more

