yii2 ActiveForm 有什么方法可以直接ajax提交?而不是自己用jq写代码去提交
//view的代码
<?php $form = ActiveForm::begin([
'action' => ['/admin/admin/adminadd'],
'id' => 'login-form',
'options' => ['class' => 'form-horizontal'],
'fieldConfig' => [
'template' => "{label}\n<div class=\"col-lg-5\">{input}</div>\n<div class=\"col-lg-5\">{error}</div>",
'labelOptions' => ['class' => 'col-lg-2 control-label'],
],
]); ?>
<?= $form->field($Admin, 'username');?>
<?= $form->field($Admin, 'password')->passwordInput();?>
<?= Html::submitButton('添加',['class' => 'btn btn-success']); ?>
<?php ActiveForm::end(); ?>
还有提交完,控制器里面怎么接收?
胡说叔叔