Home  >  Article  >  Backend Development  >  Usage analysis of Yii framework pop-up window component CJuiDialog

Usage analysis of Yii framework pop-up window component CJuiDialog

高洛峰
高洛峰Original
2017-01-09 11:11:411321browse

The example in this article describes the usage of Yii framework pop-up window component CJuiDialog. Share it with everyone for your reference, the details are as follows:

CJuiDialog component is under the manual zii.widgets.jui

Use the following code under the view

$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
 'id'=>'mydialog',//弹窗ID
 // additional javascript options for the dialog plugin
 'options'=>array(//传递给JUI插件的参数
  'title'=>'弹窗标题',
  'autoOpen'=>false,//是否自动打开
  'width'=>'auto',//宽度
  'height'=>'auto',//高度
  'buttons'=>array(
  '关闭'=>'js:function(){ $(this).dialog("close");}', ),
  ),
));
echo 'dialog content here';
$this->endWidget('zii.widgets.jui.CJuiDialog');
// 这是弹窗链接,
echo CHtml::link('open dialog', '#', array(
 'onclick'=>'$("#mydialog").dialog("open"); return false;',//点击打开弹窗
));

Usage analysis of Yii framework pop-up window component CJuiDialog

I hope this article will help you design PHP programs based on the Yii framework.

For more articles related to usage analysis of the Yii framework pop-up window component CJuiDialog, please pay attention to the PHP Chinese website!


Statement:
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