Popularity
2.5
Growing
Activity
0.0
Stable
43
28
12

Description

The validation library in CakePHP provides features to build validators that can validate arbitrary arrays of data with ease.

Code Quality Rank: L3
Monthly Downloads: 4,413
Programming language: PHP
License: MIT License
Latest version: v4.1.0-RC2

Cake Validation alternatives and similar libraries

Based on the "Filtering and Validation" category.
Alternatively, view Cake Validation alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Cake Validation or a related project?

Add another 'Filtering and Validation' Library

README

Total Downloads [License](LICENSE.txt)

CakePHP Validation Library

The validation library in CakePHP provides features to build validators that can validate arbitrary arrays of data with ease.

Usage

Validator objects define the rules that apply to a set of fields. Validator objects contain a mapping between fields and validation sets. Creating a validator is simple:

use Cake\Validation\Validator;

$validator = new Validator();
$validator
    ->requirePresence('email')
    ->add('email', 'validFormat', [
        'rule' => 'email',
        'message' => 'E-mail must be valid'
    ])
    ->requirePresence('name')
    ->notEmptyString('name', 'We need your name.')
    ->requirePresence('comment')
    ->notEmptyString('comment', 'You need to give a comment.');

$errors = $validator->validate($_POST);
if (!empty($errors)) {
    // display errors.
}

Documentation

Please make sure you check the official documentation


*Note that all licence references and agreements mentioned in the Cake Validation README section above are relevant to that project's source code only.