Category: Uncategorized

Sticky Behavior

March 27th, 2010, No Comments

This is a sticky behavior. It will cause the models it is attached to to remember the user’s last inputted value. In other words, the last value the user selected will be the default value the next time around the user fills out the form It’s not perfectly reusable unless you follow the same naming […]

CDbExpression

February 23rd, 2009, 4 Comments

Ever want to set an attribute in Active Record with a MySQL function? For instance, often times you need to set an attribute to the well known MySQL function “NOW()”. Most people first attempt this in the following way: <?php $model->createdDate = ‘NOW()'; The above, however, will most definitely not work. Why not? Because Yii […]

Feed

http://php-thoughts.cubedwater.com / Uncategorized