PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Edward Paul   Quest PHP Validation Library   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Quest PHP Validation Library
Validate values with general and custom rules
Author: By
Last change:
Date: 1 year ago
Size: 563 bytes
 

Contents

Class file image Download
<?php

require_once 'vendor/autoload.php';

$check = new \App\Checkers\Check([
   
'name' => '',
   
'email' => [
       
'infinitypaul@live.com',
       
'',
       
'ade',
       
'ade@google.com'
   
],
   
'password' => 'eeee'
]);

$check->setRules([
   
'name' => [
       
'required'
   
],
   
'email.*' => [
        new \
App\Checkers\Rules\Required(),
       
'email',
       
'blacklist'
   
],
   
'password' => [
       
'min:5',
       
'sequence'
   
]
]);


if(!
$check->validate()){
   
dump($check->getErrors());
} else {
   
dump("passed");
};