Comparing
#1 with
#2
Revision #2 was created by
c@cba on Feb 12, 2012, 3:53:50 PM.
enumDropDownList
Content
[...]
Create the file `..\components\ZHtml.php` with the following code:
```php
class ZHtml extends CHtml
{
/**
* This code was contributed by zaccaria in the forum:
* http://www.yiiframework.com/forum/index.php?/topic/10079-enum-db-type-in-yii/
* This method generates a drop down list for columns of type ENUM.
* @param CModel $model The data model.
* @param string $attribute The attribute.
* @param array $htmlOptions Addtional HTML options.
* @return string The generated drop down list with the enum values for the attribute.
*/
public static function enumDropDownList($model, $attribute, $htmlOptions=array())
{
return CHtml::activeDropDownList( $model, $attribute, self::enumItem($model, $attribute), $htmlOptions);
}[...]