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
62fc5cf6
Commit
62fc5cf6
authored
May 02, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
form WIP
parent
74f97ce5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
3 deletions
+29
-3
ActiveForm.php
framework/widgets/ActiveForm.php
+29
-3
No files found.
framework/widgets/ActiveForm.php
View file @
62fc5cf6
...
@@ -47,7 +47,7 @@ class ActiveForm extends Widget
...
@@ -47,7 +47,7 @@ class ActiveForm extends Widget
* @var string the default CSS class for the error summary container.
* @var string the default CSS class for the error summary container.
* @see errorSummary()
* @see errorSummary()
*/
*/
public
$errorSummaryCssClass
=
'
yii-
error-summary'
;
public
$errorSummaryCssClass
=
'error-summary'
;
/**
/**
* @var string the CSS class that is added to a field container when the associated attribute is required.
* @var string the CSS class that is added to a field container when the associated attribute is required.
*/
*/
...
@@ -180,15 +180,39 @@ class ActiveForm extends Widget
...
@@ -180,15 +180,39 @@ class ActiveForm extends Widget
echo
Html
::
endForm
();
echo
Html
::
endForm
();
}
}
/**
* Returns the options for the form JS widget.
* @return array the options
*/
protected
function
getClientOptions
()
protected
function
getClientOptions
()
{
{
$options
=
array
(
$options
=
array
(
'e
nableClientValidation'
=>
$this
->
enableClientValidation
,
'e
rrorSummary'
=>
'.'
.
$this
->
errorSummaryCssClass
,
'
enableAjaxValidation'
=>
$this
->
enableAjaxValidation
,
'
validateOnSubmit'
=>
$this
->
validateOnSubmit
,
'errorCssClass'
=>
$this
->
errorCssClass
,
'errorCssClass'
=>
$this
->
errorCssClass
,
'successCssClass'
=>
$this
->
successCssClass
,
'successCssClass'
=>
$this
->
successCssClass
,
'validatingCssClass'
=>
$this
->
validatingCssClass
,
'validatingCssClass'
=>
$this
->
validatingCssClass
,
);
);
if
(
$this
->
validationUrl
!==
null
)
{
$options
[
'validationUrl'
]
=
Html
::
url
(
$this
->
validationUrl
);
}
$callbacks
=
array
(
'beforeValidateAttribute'
,
'afterValidateAttribute'
,
'beforeValidate'
,
'afterValidate'
,
);
foreach
(
$callbacks
as
$callback
)
{
$value
=
$this
->
$callback
;
if
(
is_string
(
$value
))
{
$value
=
new
JsExpression
(
$value
);
}
if
(
$value
instanceof
JsExpression
)
{
$options
[
$callback
]
=
$value
;
}
}
return
$options
;
}
}
/**
/**
...
@@ -245,7 +269,9 @@ class ActiveForm extends Widget
...
@@ -245,7 +269,9 @@ class ActiveForm extends Widget
* @param Model $model the data model
* @param Model $model the data model
* @param string $attribute the attribute name or expression. See [[Html::getAttributeName()]] for the format
* @param string $attribute the attribute name or expression. See [[Html::getAttributeName()]] for the format
* about attribute expression.
* about attribute expression.
* @param array $options the additional configurations for the field object
* @return ActiveField the created ActiveField object
* @return ActiveField the created ActiveField object
* @see fieldConfig
*/
*/
public
function
field
(
$model
,
$attribute
,
$options
=
array
())
public
function
field
(
$model
,
$attribute
,
$options
=
array
())
{
{
...
...
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