Home > Backend Development > PHP Tutorial > PHP development framework Yii Framework tutorial (37) Zii component-Dialog example

PHP development framework Yii Framework tutorial (37) Zii component-Dialog example

黄舟
Release: 2023-03-05 09:28:01
Original
1537 people have browsed it

CJuiDialog is used to display dialog boxes, modal or non-modal dialog boxes. 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',
'width'=>500,
'height'=>300,
'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',
'width'=>400,
'height'=>200,
'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;')); 
?>
Copy after login

Mode and non-mode are configured by setting 'modal' =>true/false. CJuiDialog is used to define the dialog box. To display the dialog box, you still need to pass For other UI components, this example uses Link to display the dialog box.

PHP development framework Yii Framework tutorial (37) Zii component-Dialog example

The above is the content of the PHP development framework Yii Framework tutorial (37) Zii component-Dialog example. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com) !

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template