payling
(Payling1)
July 26, 2011, 2:43pm
1
I’ve just started playing with Yii framework for the first time yesterday.
I want to create a “static nested list of multiple links”… using CTreeView. The problem is I can’t even get a single list item to show up without an error.
$this->widget('system.web.widgets.CTreeView',array('data'=>array('text'=>'Home')));
Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in…
What does that mean and why is my code not working?
Thanks
payling
(Payling1)
July 26, 2011, 3:22pm
2
Just figured out what was wrong… Missing an array.
$this->widget('system.web.widgets.CTreeView',array('data'=>array('text'=>'Home')));
Should be:
$this->widget('system.web.widgets.CTreeView',array('data'=>array(array('text'=>'Home'))));
I happened to discover by comparing my code to the example here:
yiiplayground.cubedwater.com/index.php?r=UiModule/ui_other/treeView
(not allowing me to post embed link since I’m new user)
Is a great resource!