guide WIP [skip ci]

This commit is contained in:
Qiang Xue
2014-06-05 22:40:37 -04:00
parent 25f919c1df
commit 01e5ffdceb
9 changed files with 527 additions and 244 deletions

View File

@@ -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;
/**

View File

@@ -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;

View File

@@ -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.
*/

View File

@@ -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
*/

View File

@@ -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',