- Installation
- Usage
- Resources
Installation ¶
composer require --prefer-dist cetver/yii2-validation-filters
Usage ¶
trim
¶
public function rules()
{
return [
[
'attribute',
\cetver\ValidationFilters\validators\TrimValidator::className(),
'characterMask' => ' '
],
];
}
ltrim
¶
public function rules()
{
return [
[
'attribute',
\cetver\ValidationFilters\validators\LeftTrimValidator::className(),
'characterMask' => ' '
],
];
}
rtrim
¶
public function rules()
{
return [
[
'attribute',
\cetver\ValidationFilters\validators\RightTrimValidator::className(),
'characterMask' => ' '
],
];
}
ucfirst
¶
public function rules()
{
return [
[
'attribute',
\cetver\ValidationFilters\validators\MultibyteUpperCharacterFirstValidator::className(),
'encoding' => 'UTF-8'
],
];
}
lcfirst
¶
public function rules()
{
return [
[
'attribute',
\cetver\ValidationFilters\validators\MultibyteLowerCharacterFirstValidator::className(),
'encoding' => 'UTF-8'
],
];
}
strtoupper
¶
public function rules()
{
return [
[
'attribute',
\cetver\ValidationFilters\validators\MultibyteConvertCaseValidator::className(),
'mode' => MB_CASE_UPPER,
'encoding' => 'UTF-8'
],
];
}
strtolower
¶
public function rules()
{
return [
[
'attribute',
\cetver\ValidationFilters\validators\MultibyteConvertCaseValidator::className(),
'mode' => MB_CASE_LOWER,
'encoding' => 'UTF-8'
],
];
}
ucwords
¶
public function rules()
{
return [
[
'attribute',
\cetver\ValidationFilters\validators\MultibyteConvertCaseValidator::className(),
'mode' => MB_CASE_TITLE,
'encoding' => 'UTF-8'
],
];
}
mb_convert_case
¶
public function rules()
{
return [
[
'attribute',
\cetver\ValidationFilters\validators\MultibyteConvertCaseValidator::className(),
'mode' => MB_CASE_UPPER,
'encoding' => 'UTF-8'
],
];
}
Resources ¶
https://github.com/cetver/yii2-validation-filters
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.