mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
more docs for #10701
This commit is contained in:
@ -440,7 +440,9 @@ If you are interested in the attribute values prior to their most recent modific
|
|||||||
> even if it has the same value but a different type. This is often the case when the model receives user input from
|
> even if it has the same value but a different type. This is often the case when the model receives user input from
|
||||||
> HTML forms where every value is represented as a string.
|
> HTML forms where every value is represented as a string.
|
||||||
> To ensure the correct type for e.g. integer values you may apply a [validation filter](input-validation.md#data-filtering):
|
> To ensure the correct type for e.g. integer values you may apply a [validation filter](input-validation.md#data-filtering):
|
||||||
> `['attributeName', 'filter', 'filter' => 'intval']`.
|
> `['attributeName', 'filter', 'filter' => 'intval']`. This works with all the typecasting functions of PHP like
|
||||||
|
> [intval()](http://php.net/manual/en/function.intval.php), [floatval()](http://php.net/manual/en/function.floatval.php),
|
||||||
|
> [boolval](http://php.net/manual/en/function.boolval.php), etc...
|
||||||
|
|
||||||
### Default Attribute Values <span id="default-attribute-values"></span>
|
### Default Attribute Values <span id="default-attribute-values"></span>
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ with a PHP callable. For example,
|
|||||||
}]
|
}]
|
||||||
```
|
```
|
||||||
|
|
||||||
> Note: Most validators do not handle empty inputs if their [[yii\base\Validator::skipOnEmpty]] property takes
|
> Note: Most validators do not handle empty inputs if their [[yii\validators\Validator::skipOnEmpty]] property takes
|
||||||
the default value true. They will simply be skipped during validation if their associated attributes receive empty
|
the default value true. They will simply be skipped during validation if their associated attributes receive empty
|
||||||
inputs. Among the [core validators](tutorial-core-validators.md), only the `captcha`, `default`, `filter`,
|
inputs. Among the [core validators](tutorial-core-validators.md), only the `captcha`, `default`, `filter`,
|
||||||
`required`, and `trim` validators will handle empty inputs.
|
`required`, and `trim` validators will handle empty inputs.
|
||||||
|
Reference in New Issue
Block a user