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
368dd4b1
Commit
368dd4b1
authored
Nov 13, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow Validator::except to be either a string or an array.
parent
71a619d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
Validator.php
framework/yii/validators/Validator.php
+5
-7
No files found.
framework/yii/validators/Validator.php
View file @
368dd4b1
...
...
@@ -94,7 +94,8 @@ abstract class Validator extends Component
*/
public
$on
=
[];
/**
* @var array list of scenarios that the validator should not be applied to.
* @var array|string scenarios that the validator should not be applied to. For multiple scenarios,
* please specify them as an array; for single scenario, you may use either a string or an array.
*/
public
$except
=
[];
/**
...
...
@@ -163,12 +164,9 @@ abstract class Validator extends Component
public
function
init
()
{
parent
::
init
();
if
(
!
is_array
(
$this
->
attributes
))
{
$this
->
attributes
=
(
array
)
$this
->
attributes
;
}
if
(
!
is_array
(
$this
->
on
))
{
$this
->
on
=
(
array
)
$this
->
on
;
}
$this
->
attributes
=
(
array
)
$this
->
attributes
;
$this
->
on
=
(
array
)
$this
->
on
;
$this
->
except
=
(
array
)
$this
->
except
;
}
/**
...
...
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