baseUrl.'/images/'.$url;
}
/**
* Makes the given URL relative to the /css directory
*/
public static function cssUrl($url) {
return Yii::app()->baseUrl.'/css/'.$url;
}
/**
* Makes the given URL relative to the /js directory
*/
public static function jsUrl($url) {
return Yii::app()->baseUrl.'/js/'.$url;
}
public static function enumItem($model, $attribute) {
$attr = $attribute;
self::resolveName($model, $attr);
preg_match('/\((.*)\)/', $model->tableSchema->columns[$attr]->dbType, $matches);
foreach (explode(',', $matches[1]) as $value) {
$value = str_replace("'", null, $value);
$values[$value] = Yii::t('enumItem', $value);
}
return $values;
}
public static function enumDropDownList($model, $attribute, $htmlOptions = array()) {
return CHtml::activeDropDownList($model, $attribute, Html::enumItem($model, $attribute), $htmlOptions);
}
}
?>