yii: save empty field as null

by prettyscripts on 2012-01-18 10:52:00 • Leave a comment »

phpyii

this is an updated post in reference to a previous post about saving a field to null when no value is entered. thanks to those who left comment, this is the correct (and easier!) way to do it. add a new rule to the model: protected funcion rules() {… more »

Tags: code, null, php, save, yii

yii: date field save as null value

by prettyscripts on 2010-11-09 12:39:00 • 7 comments »

phpyii

by default if date is not entered in a form, the value is saved as '0000-00-00'. yii does not automaticallyl save it as null. to save the field as null, it needs to be done manuall. update (or add) beforeSave() function in model file:protected func… more »

Tags: code, null, php, save, yii

yii: rendering a view

by prettyscripts on 2010-10-29 11:58:44 • Leave a comment »

phpyii

the following codes are called from a view files, and assume the file to be included is named partial.php. to render a view from the current controller, ie view files are from the same directory:$this->renderPartial('partial'); to render a… more »

Tags: code, framework, include, php, render, view, yii

integrating smf with your website

by prettyscripts on 2007-12-03 02:03:05 • Leave a comment »

phpsmf

if you don’t want to use any standard cms package and want to write your own, read this how-to post . smf also provides integration hooks where you can write your own functions without modifying the code. read this guide . more »

Tags: code, php, smf