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
2adcd16e
Commit
2adcd16e
authored
Nov 12, 2013
by
slavcodev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update phpDoc
parent
3ff8f10d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Model.php
framework/yii/base/Model.php
+6
-6
No files found.
framework/yii/base/Model.php
View file @
2adcd16e
...
@@ -100,7 +100,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
...
@@ -100,7 +100,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
*
*
* where
* where
*
*
* - attribute list: required, specifies the attributes array to be validated;
* - attribute list: required, specifies the attributes array to be validated
, for single attribute you can pass string
;
* - validator type: required, specifies the validator to be used. It can be the name of a model
* - validator type: required, specifies the validator to be used. It can be the name of a model
* class method, the name of a built-in validator, or a validator class name (or its path alias).
* class method, the name of a built-in validator, or a validator class name (or its path alias).
* - on: optional, specifies the [[scenario|scenarios]] array when the validation
* - on: optional, specifies the [[scenario|scenarios]] array when the validation
...
@@ -128,15 +128,15 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
...
@@ -128,15 +128,15 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
* ~~~
* ~~~
* [
* [
* // built-in "required" validator
* // built-in "required" validator
* [['username'], 'required'],
* [['username'
, 'password'
], 'required'],
* // built-in "string" validator customized with "min" and "max" properties
* // built-in "string" validator customized with "min" and "max" properties
* [
['username']
, 'string', 'min' => 3, 'max' => 12],
* [
'username'
, 'string', 'min' => 3, 'max' => 12],
* // built-in "compare" validator that is used in "register" scenario only
* // built-in "compare" validator that is used in "register" scenario only
* [
['password']
, 'compare', 'compareAttribute' => 'password2', 'on' => 'register'],
* [
'password'
, 'compare', 'compareAttribute' => 'password2', 'on' => 'register'],
* // an inline validator defined via the "authenticate()" method in the model class
* // an inline validator defined via the "authenticate()" method in the model class
* [
['password']
, 'authenticate', 'on' => 'login'],
* [
'password'
, 'authenticate', 'on' => 'login'],
* // a validator of class "DateRangeValidator"
* // a validator of class "DateRangeValidator"
* [
['dateRange']
, 'DateRangeValidator'],
* [
'dateRange'
, 'DateRangeValidator'],
* ];
* ];
* ~~~
* ~~~
*
*
...
...
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