private static function loadItems() { self::$_items = array(); $models = self::model()->findAll(); foreach ($models as $model) { self::$_items[$model->state_id] = $model->state_name; } }
/** * 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; }