PHP development framework YiiFramework tutorial (37) Zii component-Dialog example
CJuiDialog is used to display a dialog box, a mode or a non-mode dialog box. It encapsulates the JUI Dialog plug-in.
The basic usage is as follows:
$ This-> beginWidget ('zii. widgets. jui. CJuiDialog ', array (
'Id' => 'mydialog ',
'Options' => array (
'Title' => 'dialog ',
& Apos; width & apos; = & apos; 500 & apos,
& Apos; height & apos; = & apos; 300 & apos,
'Autoopen' => false,
),
));
Echo 'dialog content here ';
$ This-> endWidget ('zii. widgets. jui. CJuiDialog ');
?>
Array ('onclick' => '$ ("# mydialog"). dialog ("open"); return false;');?>
$ This-> beginWidget ('zii. widgets. jui. CJuiDialog ', array (
'Id' => 'mymodal ',
'Options' => array (
'Title' => 'modal Dialog ',
& Apos; width & apos; = & apos; 400 & apos,
& Apos; height & apos; = & apos; 200 & apos,
'Autoopen' => false,
'Resizable' => false,
'Modal' => true,
'Overlay '=> array (
'Backgroundcolor' => '#000 ',
'Opacity '=> '0. 5'
),
'Buttons' => array (
'OK' => 'JS: function () {alert ("OK ");}',
'Cancel' => 'JS: function () {$ (this). dialog ("close ");}',
),
),
));
Echo 'modal dialog content here ';
$ This-> endWidget ('zii. widgets. jui. CJuiDialog ');
?>
Array ('onclick' => '$ ("# mymodal"). dialog ("open"); return false;');?>
Mode and non-mode are configured by setting 'modal' => true/false. CJuiDialog defines the dialog box. to display the dialog box, you must use other UI components, in this example, the dialog box is displayed through Link.