mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-15 13:58:24 +08:00
Added SafeValidator.
This commit is contained in:
24
framework/yii/validators/SafeValidator.php
Normal file
24
framework/yii/validators/SafeValidator.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,7 @@ use yii\base\NotSupportedException;
|
||||
* - `integer`: [[NumberValidator]]
|
||||
* - `match`: [[RegularExpressionValidator]]
|
||||
* - `required`: [[RequiredValidator]]
|
||||
* - `safe`: [[SafeValidator]]
|
||||
* - `string`: [[StringValidator]]
|
||||
* - `unique`: [[UniqueValidator]]
|
||||
* - `url`: [[UrlValidator]]
|
||||
@@ -66,6 +67,7 @@ abstract class Validator extends Component
|
||||
'match' => 'yii\validators\RegularExpressionValidator',
|
||||
'number' => 'yii\validators\NumberValidator',
|
||||
'required' => 'yii\validators\RequiredValidator',
|
||||
'safe' => 'yii\validators\SafeValidator',
|
||||
'string' => 'yii\validators\StringValidator',
|
||||
'unique' => 'yii\validators\UniqueValidator',
|
||||
'url' => 'yii\validators\UrlValidator',
|
||||
|
||||
Reference in New Issue
Block a user