[size=2]I am trying to override CGridView cssFile within a module, but i am having no luck with the task.
Inside the init() module function i am setting these components:
$this->setComponents(array(
...
'widgetFactory' => array(
'class' => 'CWidgetFactory',
'widgets' => array(
array(
'CLinkPager'=>array(
'maxButtonCount'=>5,
'cssFile' => $this->getAssetsUrl() . '/css/pager.css'
),
'CGridView'=>array(
'cssFile' => $this->getAssetsUrl() . '/css/gridview.css'
),
)
)
),
));
I have a custom asset directory for my module, that i retrieve with getAssetsUrl function.
Assets manager works fine, i am using it directly inside a layout without troubles:
...
$cs = Yii::app()->clientScript;
$assetsUrl = $this->module->assetsUrl;
$cs->registerCssFile($assetsUrl . '/css/reset.css');
...
In addition, if i set directly the property in the widget call it works fine:
$this->widget('zii.widgets.grid.CGridView', array(
...
'cssFile' => $this->module->getAssetsUrl() . '/css/gridview.css',
...
));
As a note, it seems the module components arent beign initialized after i call $module->getComponents() in the code.[/size]