前端:
<a href="javascript:void(0)"Yii控制器:
data-toggle="topjui-menubutton"
data-options="method:'openDialog',
extend: '#productDg-toolbar',
iconCls: 'fa fa-plus',
btnCls: 'topjui-btn-blue',
dialog:{
id:'userAddDialog',
title:'新增用户',
href:_ctx + 'user/add',
width: 750,
height: 350,
buttonsGroup:[
{text:'保存',url:_ctx + 'user/add',iconCls:'fa fa-plus',handler:'ajaxForm',btnCls:'topjui-btn-green'}
]
}">新增用户</a>
$model = new AddUserForm();
if(Yii::$app->request->isPost){
$model->load(Yii::$app->request->post());
return returnStatus(200, '操作成功', '成功添加用户'.$model->username) ? : true;
}