wirwolf/yii2-request-validator

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

v1.2.2 2016-12-23 09:50 UTC

This package is auto-updated.

Last update: 2020-02-07 20:59:57 UTC


README

Library to validate input data(method,payload,headers)

Installation

Run command

composer require wirwolf/yii2-request-validator
composer update

Or add

"wirwolf/yii2-request-validator": "*"

to the require section of your composer.json file.

Usage

In any controller add behavior requestValidator.

Example:

    public function behaviors()
    {
        return [
            'requestValidator' => [
                'class' => ActionValidator::className(),
                'actions' => [
                    'index' => [
                        'get' => [
                            'headers' => false,
                            'fields' => [
                                'key' => '',
                                'recursiveKey' => ['key']
                            ],
                        ]
                    ],
                ],
            ]
        ];
    }

TODO:

Bugfix: remote any value from fields

Add: field type validator. IsRequired, field type(\yii\validators) and default value

Add: Functional tests