nuffic/yii2-inarray-validator

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (dev-master) of this package.

in_array validator for Yii 2

dev-master 2015-11-10 17:32 UTC

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']],
        ];
    }