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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
b2630575
Commit
b2630575
authored
Jun 23, 2014
by
Kevin LEVRON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typo [skip ci]
parent
41cbebf6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
input-validation.md
docs/guide/input-validation.md
+5
-5
No files found.
docs/guide/input-validation.md
View file @
b2630575
...
@@ -322,7 +322,7 @@ the method/function is:
...
@@ -322,7 +322,7 @@ the method/function is:
* @param string $attribute the attribute currently being validated
* @param string $attribute the attribute currently being validated
* @param array $params the additional name-value pairs given in the rule
* @param array $params the additional name-value pairs given in the rule
*/
*/
function
(
$
model
,
$attribute
)
function
(
$
attribute
,
$params
)
```
```
If an attribute fails the validation, the method/function should call
[
[yii\base\Model::addError()
]
] to save
If an attribute fails the validation, the method/function should call
[
[yii\base\Model::addError()
]
] to save
...
@@ -364,9 +364,9 @@ class MyForm extends Model
...
@@ -364,9 +364,9 @@ class MyForm extends Model
> Note: By default, inline validators will not be applied if their associated attributes receive empty inputs
> Note: By default, inline validators will not be applied if their associated attributes receive empty inputs
or if they have already failed some validation rules. If you want to make sure a rule is always applied,
or if they have already failed some validation rules. If you want to make sure a rule is always applied,
you may configure the
[
[yii\
base\Validator::skipOnEmpty|skipOnEmpty
]
] and/or
[
[yii\base
\Validator::skipOnError|skipOnError
]
]
you may configure the
[
[yii\
validators\Validator::skipOnEmpty|skipOnEmpty
]
] and/or
[
[yii\validators
\Validator::skipOnError|skipOnError
]
]
properties to be false in the rule declarations. For example
,
properties to be false in the rule declarations. For example
:
```
php
>
```php
[
[
[
'country', 'validateCountry', 'skipOnEmpty' => false, 'skipOnError' => false
]
,
[
'country', 'validateCountry', 'skipOnEmpty' => false, 'skipOnError' => false
]
,
]
]
...
@@ -529,7 +529,7 @@ JS;
...
@@ -529,7 +529,7 @@ JS;
> Tip: The above code is given mainly to demonstrate how to support client-side validation. In practice,
> Tip: The above code is given mainly to demonstrate how to support client-side validation. In practice,
you may use the [in](tutorial-core-validators.md#in) core validator to achieve the same goal. You may
you may use the [in](tutorial-core-validators.md#in) core validator to achieve the same goal. You may
write the validation rule like the following:
write the validation rule like the following:
```
php
>
```php
[
[
['status', 'in', 'range' => Status::find()->select('id')->asArray()->column()],
['status', 'in', 'range' => Status::find()->select('id')->asArray()->column()],
]
]
...
...
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