PHP code example of escuelait / magnific-validator
1. Go to this page and download the library: Download escuelait/magnific-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/ */
escuelait / magnific-validator example snippets
use Escuelait\MagnificValidator\Validator;
$validatorFactory = new ValidatorsFactory();
// Validador de formulario
$validator = $validatorFactory->create([
'email' => ['echo "Valid data!";
} else {
echo "Has validation errors:\n";
print_r($errors);
}
// Validador de un campo
$validator = $validatorFactory->create(['ho "Valid data!";
} else {
echo "Has validation errors:\n";
print_r($errors);
}