nuffic / yii2-inarray-validator
in_array validator for Yii 2
Installs: 468
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/nuffic/yii2-inarray-validator
This package is not auto-updated.
Last update: 2016-10-26 09:41:38 UTC
README
Yii validator that checks if model attribute is in given array.
How to use?
Installation with Composer
Just add the line under require
object in your composer.json
file.
{ "require": { "nuffic/yii2-inarray-validator" : "dev-master" } }
then run
$> composer update
Usage
use nuffic\validators\InArrayValidator; public function rules() { return [ [['find_me'], InArrayValidator::className(), 'array' => ['my', 'super', 'awesome', 'array']], ]; }