Form Field Generation


I start using yii form last month and exploring its features.All are so smart

Thanks to yii team.

My Point is

When creating From with the help of gii tool

Form Field should be dropdown against ‘ENUM’ Type of mysql database.

Is it ok?

is it ok, but is not the default implementation.

For have a dropdowl list, use this code in your view/form.php:



		$enum=substr($enum, $off+1, strlen($enum)-$off-2);





		return CHtml::activeDropDownList($model,'attributes',



@zaccaria Thnks for code sample

but i was just wondering if gii can be so smart to handle such option.

Else there are other ways ofcourse.

You can personalize gii by exteding it, in order to add this feature and generate code more close to your final need.

Thnks Boss