YII2 做弹窗页面然后修改弹窗的内容
推荐:《yii教程》
模板list.php的源码如下<?php
echo $this->render('remarks',['model'=>$remarkModel]);
?>
$(document).ready(function(){
$(".btn_edit").click(function(){
$.ajax({
url: "=yii::$app->request->baseUrl;?>/usersupervise/remarksuser",
type: "get",
data: {openid : 'o_-7SspsJjg4e8_dxtSznVGPJ9H4'},
success: function(data){
$('.showDiv_opaciy, .showDiv_edit').show();
}
});
});
});
模板弹窗 tanchuang.php<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
?>
= $form->field($model, 'remarkname',['inputOptions' => ['class' => 'inputText inputText_w230 inputText_remarkName']]) ?>
控制器 user.phppublic function actionRemarksuser()
{
if(yii::$app->request->isAjax){
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
print_r($openId['fromusername']);//打印不出来,用JS调用实现参数打印
}
return $this->renderAjax('remarks',['model'=>$model]);
}
}