I was looking to put a dynamic popup dialog in a yii menu but am missing a trick to make it dynamic. (edited: or maybe the question should be 'How can I pass a widget some text through a variable from a menu array) As per the code below:
/*Create A Popup Dialog (Gets called from menu)*/
$this->beginWidget('zii.widgets.jui.CJuiDialog',array(
'id'=>'mydialog',
'options'=>array(
'title'=>'Menu Alert',
'autoOpen'=>false,
),
));
echo $dialogText; //Dynamic rather than just static text
$this->endWidget('zii.widgets.jui.CJuiDialog');
/* End of Popup Menu*/
//------------------------------------------------
$this->menu=array(
array('label'=>'Help', 'url'=>array('xyz'),'linkOptions' => array('onclick' => '$("#mydialog").dialog("open"); return false;','dialogText'=>'Available Soon')),
);
When I use this code, a dialog box appears without the dialog message 'Available Soon'