yii2 ajaxform
1.0.2
استخدام jquery.form
لجعل ActiveForm
لديه القدرة على الإرسال عبر ajax ولكن ليس إعادة تحميل الصفحة بالكامل.
باستخدام الملحن:
$ composer require light/yii2-ajaxform=*
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.")} ' )
]
])
enableAjaxSubmit
الافتراضي هو صحيحajaxSubmitOptions
في jquery.form $ phpunit