mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-13 04:38:03 +08:00
guide WIP [skip ci]
This commit is contained in:
@@ -19,15 +19,16 @@ namespace yii\validators;
|
||||
class DefaultValueValidator extends Validator
|
||||
{
|
||||
/**
|
||||
* @var mixed a PHP callable returning the default value or the default value to be set to the specified attributes.
|
||||
* The function signature must be as follows,
|
||||
* @var mixed the default value or a PHP callable that returns the default value which will
|
||||
* be assigned to the attributes being validated if they are empty. The signature of the PHP callable
|
||||
* should be as follows,
|
||||
*
|
||||
* ~~~
|
||||
* function foo($object, $attribute) {
|
||||
* ```php
|
||||
* function foo($model, $attribute) {
|
||||
* // compute value
|
||||
* return $value;
|
||||
* }
|
||||
* ~~~
|
||||
* ```
|
||||
*/
|
||||
public $value;
|
||||
/**
|
||||
|
||||
@@ -37,8 +37,8 @@ class EmailValidator extends Validator
|
||||
*/
|
||||
public $allowName = false;
|
||||
/**
|
||||
* @var boolean whether to check whether the emails domain exists and has either an A or MX record.
|
||||
* Be aware of the fact that this check can fail due to temporary DNS problems even if the email address is
|
||||
* @var boolean whether to check whether the email's domain exists and has either an A or MX record.
|
||||
* Be aware that this check can fail due to temporary DNS problems even if the email address is
|
||||
* valid and an email would be deliverable. Defaults to false.
|
||||
*/
|
||||
public $checkDNS = false;
|
||||
|
||||
@@ -61,7 +61,6 @@ class ExistValidator extends Validator
|
||||
* is the [[\yii\db\Query|Query]] object that you can modify in the function.
|
||||
*/
|
||||
public $filter;
|
||||
|
||||
/**
|
||||
* @var boolean whether to allow array type attribute.
|
||||
*/
|
||||
|
||||
@@ -52,10 +52,10 @@ class ImageValidator extends FileValidator
|
||||
*/
|
||||
public $maxHeight;
|
||||
/**
|
||||
* @var array|string a list of file mime types that are allowed to be uploaded.
|
||||
* This can be either an array or a string consisting of file mime types
|
||||
* @var array|string a list of file MIME types that are allowed to be uploaded.
|
||||
* This can be either an array or a string consisting of file MIME types
|
||||
* separated by space or comma (e.g. "image/jpeg, image/png").
|
||||
* Mime type names are case-insensitive. Defaults to null, meaning all mime types
|
||||
* Mime type names are case-insensitive. Defaults to null, meaning all MIME types
|
||||
* are allowed.
|
||||
* @see wrongMimeType
|
||||
*/
|
||||
|
||||
@@ -76,6 +76,7 @@ class Validator extends Component
|
||||
'trim' => [
|
||||
'class' => 'yii\validators\FilterValidator',
|
||||
'filter' => 'trim',
|
||||
'skipOnArray' => true,
|
||||
],
|
||||
'unique' => 'yii\validators\UniqueValidator',
|
||||
'url' => 'yii\validators\UrlValidator',
|
||||
|
||||
Reference in New Issue
Block a user