1. Go to this page and download the library: Download kocal/validator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Kocal\Validator\Validator;
$validator = new Validator([], 'es');
use Kocal\Validator\Validator;
$validator = new Validator(['field' => 'is_foo']);
$validator->extend('is_foo', function ($attribute, $value, $parameters, $validator) {
return $value == 'foo';
}, "Le champ :attribute n'est pas égal à 'foo'.");
$validator->validate(['field' => 'not_foo']);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.