marciocamello/yii2-mcms-ajax-form

使用malsup jquery-form的Ajax表单

dev-master 2014-04-29 17:10 UTC

This package is not auto-updated.

Last update: 2024-09-24 06:36:47 UTC


README

使用malsup jquery-form的Ajax表单

安装

安装此扩展的首选方式是通过composer

运行以下命令之一:

php composer.phar require --prefer-dist marciocamello/yii2-mcms-ajax-form "*"

或者在您的composer.json文件的require部分添加:

"marciocamello/yii2-mcms-ajax-form": "*"

to the require section of your composer.json file.

使用

安装扩展后,只需在代码中通过

<?php
  $form = \mcms\ajaxform\AjaxActiveForm::begin([
					'id' => 'register-form',
					'options'=>[
						'enctype'=>'multipart/form-data'
					],
					'modal' => true,
					'modalOptions' => [
						'header' => false,
					],
					'pluginOptions' => [
						'resetForm' => false,
					],
				]);
?>

Your form objects here.
				
<?php \mcms\ajaxform\AjaxActiveForm::end();?>