Home > Backend Development > PHP Tutorial > yii 的组件Cdialog如何将值传递到控制器中去?

yii 的组件Cdialog如何将值传递到控制器中去?

WBOY
Release: 2016-06-23 14:14:39
Original
1037 people have browsed it

yii 的组件Cdialog如何将值传递到控制器中去?

<form name="myform" method ="post"> <?php  //传值对话框$this->beginWidget('zii.widgets.jui.CJuiDialog', array(	'id'=>'mymodalg2',	'options'=>array(				'title'=>'请输入取消订单的原因',				'width'=>600,				'height'=>400,				'autoOpen'=>false,				'resizable'=>false,				'modal'=>true,				'overlay'=>array(					'backgroundColor'=>'#000',					'opacity'=>'0.5'					),				'buttons'=>array(					//'OK'=>'js:function(){alert("OK");}',					'确认操作'=>'js:function(){ alert("提交成功");}',					'取消操作'=>'js:function(){$(this).dialog("close");}',					),				),			));//echo 'Modal dialog content here ';//echo '<br />';//echo CHtml::label('请填写取消订单的原因', ''); echo CHtml::textArea('myparm', '' ,array('rows'=>13, 'cols'=>67));$this->endWidget('zii.widgets.jui.CJuiDialog');?></form> 
Copy after login


回复讨论(解决方案)

没有用过,一看CDialog以为进错了MFC版

------------------------------------------------------AutoCSDN签名档------------------------------------------------------

码农场??码农播种代码、放牧思想的农场!

其他还是和我们正常使用基本的HTML提交表单一样,只需要把form的action属性写好,在form中设置要提交的域的name属性即可。另外Yii的Dialog还可以这么写,个人觉得很灵活:

<form name="myform" method ="post" action="ActionURL"> <?php  //传值对话框$this->beginWidget('zii.widgets.jui.CJuiDialog', array(    'id'=>'mymodalg2',    'options'=>array(                'title'=>'请输入取消订单的原因',                'width'=>600,                'height'=>400,                'autoOpen'=>false,                'resizable'=>false,                'modal'=>true,                'overlay'=>array(                    'backgroundColor'=>'#000',                    'opacity'=>'0.5'                    ),                'buttons'=>array(                    //'OK'=>'js:function(){alert("OK");}',                    '确认操作'=>'js:function(){ alert("提交成功");}',                    '取消操作'=>'js:function(){$(this).dialog("close");}',                    ),                ),            ));//echo 'Modal dialog content here ';//echo '<br />';?>//echo CHtml::label('请填写取消订单的原因', ''); //echo CHtml::textArea('myparm', '' ,array('rows'=>13, 'cols'=>67));<input type="text" name="fieldName1" value="这个值可以提交"/><input type="text" name="filedName2" value="这个值当然也可以提交到ActionURL"/><php$this->endWidget('zii.widgets.jui.CJuiDialog');?></form> 
Copy after login

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