I would be grateful if anyone can point out what I’m doing wrong here…
I’ve made a widget that extends CListView, and added a couple of options to it (public $opt1; public $opt2 etc). I’ve overridden two methods - the init() and the registerClientScript methods. In the init method I simply publish an asset before calling parent::init();
I call my widget from a view, with the config array filled out. The ListView works fine, but if I set my options in the config array (‘opt1’ => ‘test’, ‘opt2’ => ‘test2’ etc) they are not taken into account in the widget, ie when the widget renders, they are null as if no value had been assigned to them.
They obviously exist, because if I fill in a non existent option variable in the config array, I get an exception, but filling in the ones I have made I get no exception, but the value is never transferred (but all the non custom config values such as the dataprovider work fine).
So please tell me if this is the right way to proceed (adding public properties to the widget class and giving them values in the config array passed to the widget), and if so, why my config values are not being passed on.