Is there a way to set default settings for all CGridViews, CDetailViews, CListViewes like
cssFile, baseScriptUrl, showTableOnEmpty
Is there a way to set default settings for all CGridViews, CDetailViews, CListViewes like
cssFile, baseScriptUrl, showTableOnEmpty
E ae Tiagão
Extend these classes setting up the options/properties with initial values like:
class myGridView extends CGridView{
public $option='myInitialValue';
}
and use it like :
$this->widget('ext.myGridView',array('model'=>myModel::model()));
and thats it
I also do the same to be faster
also you could create a function to do the job
function myGridView($model,$config=array()){
$config=array_merge(
array('config1'=>'value1','model'=>$model),
$config
);
return Yii::app()->getController()->widget('zii.widgets.CGridView',$config);
}
Also consider this. If applicable, would be more straightforward.
/Tommy
Thanks Gustavo. This work fine!
Thanks Tommy!!!