Commit 01e5ffdc by Qiang Xue

guide WIP [skip ci]

parent 25f919c1
......@@ -173,6 +173,7 @@ Special Topics
* [Advanced Application Template](tutorial-advanced-app.md)
* [Building Application from Scratch](tutorial-start-from-scratch.md)
* [Console Commands](tutorial-console.md)
* [Core Validators](tutorial-core-validators.md)
* [Internationalization](tutorial-i18n.md)
* [Mailing](tutorial-mailing.md)
* [Performance Tuning](tutorial-performance-tuning.md)
......
Working with forms
Working with Forms
==================
> Note: This section is under development.
......
......@@ -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',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment