Default settings for all CGridViews

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 :


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()){





	return Yii::app()->getController()->widget('zii.widgets.CGridView',$config);


Also consider this. If applicable, would be more straightforward.


Thanks Gustavo. This work fine!

Thanks Tommy!!!