Hi all,
I am a yii newbie. I have searched on the forum but couldn’t find any reference on how to call a javascript function from view, Operations link to show popup box.
Here is what I have done,
<?php
//the javascript that doing the jobs
$script ="function myPopup() {
window.open(‘http://www.google.com/’);
}
}";
//put the script to the view
Yii::app()->clientScript->registerScript(‘js1’, $script, CClientScript::POS_END);
?>
$this->menu=
array(array(‘label’=>‘New Appointment’,‘url’=>array(‘appointment/create’, ‘patient_id’=>$model->patient_id,array(‘onclick’=>‘myPopup()’)))
);
Any help will be much appreciated, thanks.