示例#1
0
 private static function loadItems()
 {
     self::$_items = array();
     $models = self::model()->findAll();
     foreach ($models as $model) {
         self::$_items[$model->state_id] = $model->state_name;
     }
 }
示例#2
0
	/**
	* Generate array for dropdown list to use in child form.
	* @return array $_items
	*/
	public static function items()
	{
	    self::$_items = CHtml::listData(self::model()->findAll(), 'state_id', 'state_name');
	    return self::$_items;
	}