yii2-ajaxform [ 2.0 版本 ]
Overview
Using jquery.form
to make ActiveForm
has ability to submit via ajax but not fullpage reload.
Install
Using composer:
$ composer require light/yii2-ajaxform=*
Usage
use light\widgets\ActiveForm;
use yii\web\JsExpression;
ActiveForm::begin([
'ajaxSubmitOptions' => [
'success' => new JsExpression('function(response) {console.log(response)}'),
'complete' => new JsExpression('function() {console.log("request completed.")}')
]
])
Options
- Default enabled
enableAjaxSubmit
is true ajaxSubmitOptions
you can find in jquery.form
Test
$ phpunit
LICENSE
__FresHmaN
注册时间:2015-05-05
最后登录:2016-02-15
在线时长:0小时54分
最后登录:2016-02-15
在线时长:0小时54分
- 粉丝2
- 金钱35
- 威望20
- 积分235
共 0 条评论