Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
4e9dc981
Commit
4e9dc981
authored
Apr 30, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
form WIP
parent
a2594b7d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
1 deletion
+31
-1
assets.php
framework/assets.php
+9
-1
yii-form.js
framework/assets/yii-form.js
+0
-0
yii-validation.js
framework/assets/yii-validation.js
+16
-0
ActiveForm.php
framework/widgets/ActiveForm.php
+6
-0
No files found.
framework/assets.php
View file @
4e9dc981
...
...
@@ -14,11 +14,18 @@ return array(
),
'depends'
=>
array
(
'jquery'
),
),
'yii/validation'
=>
array
(
'sourcePath'
=>
__DIR__
.
'/assets'
,
'js'
=>
array
(
'yii-validation.js'
,
),
'depends'
=>
array
(
'yii'
),
),
'yii/form'
=>
array
(
'sourcePath'
=>
__DIR__
.
'/assets'
,
'js'
=>
array
(
'yii-form.js'
,
),
'depends'
=>
array
(
'yii'
),
'depends'
=>
array
(
'yii'
,
'yii/validation'
),
),
);
\ No newline at end of file
framework/assets/yii-form.js
View file @
4e9dc981
This diff is collapsed.
Click to expand it.
framework/assets/yii-validation.js
0 → 100644
View file @
4e9dc981
/**
* 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
framework/widgets/ActiveForm.php
View file @
4e9dc981
...
...
@@ -75,6 +75,7 @@ class ActiveForm extends Widget
*/
public
function
init
()
{
$this
->
options
[
'id'
]
=
$this
->
getId
();
echo
Html
::
beginForm
(
$this
->
action
,
$this
->
method
,
$this
->
options
);
}
...
...
@@ -84,6 +85,11 @@ class ActiveForm extends Widget
*/
public
function
run
()
{
$id
=
$this
->
getId
();
$options
=
array
();
$options
=
json_encode
(
$options
);
$this
->
view
->
registerAssetBundle
(
'yii/form'
);
$this
->
view
->
registerJs
(
"jQuery('#
$id
').yii.form(
$options
);"
);
echo
Html
::
endForm
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment