Yii Framework Forum: Custom conifguration in widget not taken into account - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Custom conifguration in widget not taken into account Rate Topic: -----

#1 User is offline   RedRabbit 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 183
  • Joined: 24-September 10

Posted 07 February 2011 - 02:47 AM

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.
Rupert
0

#2 User is offline   RedRabbit 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 183
  • Joined: 24-September 10

Posted 08 February 2011 - 12:06 PM

Bump!

Any suggestions anyone?
Rupert
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users