Commit 81143165 by Qiang Xue

form wip

parent 4e9dc981
...@@ -17,14 +17,14 @@ return array( ...@@ -17,14 +17,14 @@ return array(
'yii/validation' => array( 'yii/validation' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'yii-validation.js', 'yii.validation.js',
), ),
'depends' => array('yii'), 'depends' => array('yii'),
), ),
'yii/form' => array( 'yii/form' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'yii-form.js', 'yii.activeForm.js',
), ),
'depends' => array('yii', 'yii/validation'), 'depends' => array('yii', 'yii/validation'),
), ),
......
/**
* Yii form widget.
*
* This is the JavaScript widget used by the yii\widgets\ActiveForm widget.
*
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
!function ($) {
}(window.jQuery);
\ No newline at end of file
...@@ -7,10 +7,24 @@ ...@@ -7,10 +7,24 @@
* @author Qiang Xue <qiang.xue@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0 * @since 2.0
*/ */
;(function($) { yii = (function ($) {
var pub = {
$.yii = { version: '2.0'
version : '2.0'
}; };
return pub;
})(jQuery); })(jQuery);
jQuery(document).ready(function ($) {
// call the init() method of every module
var init = function (module) {
if ($.isFunction(module.init) && (module.trigger == undefined || $(module.trigger).length)) {
module.init();
}
$.each(module, function () {
if ($.isPlainObject(this)) {
init(this);
}
});
};
init(yii);
});
/** /**
* Yii form widget. * Yii validation module.
* *
* This is the JavaScript widget used by the yii\widgets\ActiveForm widget. * This is the JavaScript widget used by the yii\widgets\ActiveForm widget.
* *
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
* @since 2.0 * @since 2.0
*/ */
!function ($) { yii.validation = (function ($) {
var pub = {
}(window.jQuery); };
\ No newline at end of file return pub;
})(jQuery);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment