Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
d849cda3
Commit
d849cda3
authored
Oct 16, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more validator refactoring.
parent
06765e9a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
laravel/validation/validator.php
+10
-2
No files found.
laravel/validation/validator.php
View file @
d849cda3
...
...
@@ -508,6 +508,7 @@ class Validator {
{
return
$this
->
messages
[
$attribute
.
'_'
.
$rule
];
}
// Next we'll check for developer specified, rule specific messages. These allow the
// developer to override the error message for an entire rule, regardless of the
// attribute being validated by that rule.
...
...
@@ -515,12 +516,20 @@ class Validator {
{
return
$this
->
messages
[
$rule
];
}
// If the rule being validated is a "size" rule and the attribute is not a number,
// we will need to gather the specific size message for the type of attribute
// being validated, either a file or a string.
elseif
(
in_array
(
$rule
,
$this
->
size_rules
)
and
!
$this
->
has_rule
(
$attribute
,
$this
->
numeric_rules
))
{
$line
=
(
array_key_exists
(
$attribute
,
Input
::
file
()))
?
"file"
:
"string"
;
return
Lang
::
line
(
"validation.
{
$rule
}
.
{
$line
}
"
)
->
get
(
$this
->
language
);
}
// If no developer specified messages have been set, and no other special messages
// apply to the rule, we will just pull the default validation message from the
// validation language file.
else
{
return
Lang
::
line
(
"validation.
{
$rule
}
"
)
->
get
(
$this
->
language
);
...
...
@@ -628,8 +637,7 @@ class Validator {
public
function
__call
(
$method
,
$parameters
)
{
// First we will slice the "validate_" prefix off of the validator
// since custom validators are not registered with such a prefix.
// Then, if a custom validator exists, we will call it.
// since customvalidators aren't registered with such a prefix.
if
(
isset
(
static
::
$validators
[
$method
=
substr
(
$method
,
9
)]))
{
return
call_user_func_array
(
static
::
$validators
[
$method
],
$parameters
);
...
...
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