How to avoid the "NULL" string by default in form fields ?
Posted 29 October 2009 - 04:40 AM
I have some fields in my database with NULL as their default value. With the form created by the yiic command, these fields display by default the "NULL" string. I would want to display an empty string instead. How can i do that ? I browse the docs but i can't find anything related to this subject.
Thank you very much.
Posted 30 October 2009 - 08:05 AM
In my case, i can modify my database structure so i could indeed change the default value in my table. But sometimes you can't make this kind of change.
Posted 30 October 2009 - 10:01 AM
Sure but Yii reads the fields values from the database. So, there is no way to convert the fields values read in the database by Yii just before the display in the form ? Something like this :
DB values -> Yii read these values -> ** Filter to convert null to empty string ** -> Form display (without any null)
I'm not sure to be very clear in my explanation... :-)