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
c037b481
Commit
c037b481
authored
Aug 25, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added SafeValidator.
parent
ac4b8757
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
SafeValidator.php
framework/yii/validators/SafeValidator.php
+24
-0
Validator.php
framework/yii/validators/Validator.php
+2
-0
No files found.
framework/yii/validators/SafeValidator.php
0 → 100644
View file @
c037b481
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\validators
;
/**
* SafeValidator serves as a dummy validator whose main purpose is to mark the attributes to be safe for massive assignment.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class
SafeValidator
extends
Validator
{
/**
* @inheritdoc
*/
public
function
validateAttribute
(
$object
,
$attribute
)
{
}
}
framework/yii/validators/Validator.php
View file @
c037b481
...
@@ -35,6 +35,7 @@ use yii\base\NotSupportedException;
...
@@ -35,6 +35,7 @@ use yii\base\NotSupportedException;
* - `integer`: [[NumberValidator]]
* - `integer`: [[NumberValidator]]
* - `match`: [[RegularExpressionValidator]]
* - `match`: [[RegularExpressionValidator]]
* - `required`: [[RequiredValidator]]
* - `required`: [[RequiredValidator]]
* - `safe`: [[SafeValidator]]
* - `string`: [[StringValidator]]
* - `string`: [[StringValidator]]
* - `unique`: [[UniqueValidator]]
* - `unique`: [[UniqueValidator]]
* - `url`: [[UrlValidator]]
* - `url`: [[UrlValidator]]
...
@@ -66,6 +67,7 @@ abstract class Validator extends Component
...
@@ -66,6 +67,7 @@ abstract class Validator extends Component
'match'
=>
'yii\validators\RegularExpressionValidator'
,
'match'
=>
'yii\validators\RegularExpressionValidator'
,
'number'
=>
'yii\validators\NumberValidator'
,
'number'
=>
'yii\validators\NumberValidator'
,
'required'
=>
'yii\validators\RequiredValidator'
,
'required'
=>
'yii\validators\RequiredValidator'
,
'safe'
=>
'yii\validators\SafeValidator'
,
'string'
=>
'yii\validators\StringValidator'
,
'string'
=>
'yii\validators\StringValidator'
,
'unique'
=>
'yii\validators\UniqueValidator'
,
'unique'
=>
'yii\validators\UniqueValidator'
,
'url'
=>
'yii\validators\UrlValidator'
,
'url'
=>
'yii\validators\UrlValidator'
,
...
...
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