Yii中POS和GET并用范例
页面
<?php $form=$this->beginWidget('CActiveForm', array( 'id'=>'add-form', 'enableAjaxValidation'=>false, 'method'=>'post', 'action'=>$this->createUrl($this->route, array('username'=>$model->name, 'domain'=>$model->domain)), )); ?> <?php echo $form->textArea($input, "mail", array("rows" => "10", "cols" => "100", "style"=>"ime-mode:disabled;"));?> <?php echo CHtml::button('追加', array( 'confirm'=>'确认消息', 'submit'=>array(), 'params'=>array('YII_CSRF_TOKEN' => Yii::app()->request->csrfToken, "add" => 1), 'class'=>'button', )); ?> <?php echo CHtml::button('検索', array( 'submit'=>array(), 'params'=>array('YII_CSRF_TOKEN' => Yii::app()->request->csrfToken, "search" => 1), 'class'=>'button', )); ?> </p> <?php $this->endWidget(); ?>
控制器:
if (!isset($_GET['username']) || !isset($_GET['domain'])) { if (isset($_POST["addmail"])) { Yii::log("追加 " . $_POST["Input"]["mail"]) ; } if (isset($_POST["search"])) { Yii::log("検索 " . $_POST["Input"]["mail"]) ; } }
相关推荐
WasteLand 2020-10-18
Allinputs 2020-08-30
Ashes 2020-06-14
caiyiii 2020-06-14
kxguan 2020-06-14
daillo 2020-06-14
一粒沙里的世界 2020-06-14
ruxingli 2020-06-14
csssy00 2020-06-14
阿佐 2020-06-14
NameWFY 2020-05-28
NameWFY 2020-05-26
Robin罗兵 2020-05-16
caiyiii 2020-04-29
wmsjlihuan 2020-04-26
cbao 2020-04-26
csssy00 2020-04-19
igogo00 2020-03-09