Download the PHP package herroffizier/yii2-attribute-index-validator without Composer
On this page you can find all versions of the php package herroffizier/yii2-attribute-index-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package yii2-attribute-index-validator
Yii2 Attribute Index Validator
This validator solves value collisions for unique model attributes by adding incremental index to repeating values. E.g. will become if item with already exists.
Such behavior may be useful for tasks like generating URLs and so on.
Installation
Install validator with Composer:
Usage
Add validator to your model's rules array before required
and unique
validators (if any).
Validator has a few options to customize its behavior.
- sets separator between original value and index. Default separator is .
- defines start index. Default value is .
- defines additional filter to be applied to query used to check attribute uniqueness. May be either a string, an array or an anonymous function. In case of string or array value will be passed to method. In case of anonymous function its signature must be and instance of will be passed to it. Default value is .
All versions of yii2-attribute-index-validator with dependencies
PHP Build Version
Package Version
Requires
yiisoft/yii2 Version
*
The package herroffizier/yii2-attribute-index-validator contains the following files
Loading the files please wait ....