PHP Classes

File: example/date.php

Recommend this page to a friend!
  Classes of Boss Ibrahim Mussa   Wepesi Validation   example/date.php   Download  
File: example/date.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Wepesi Validation
Validate a set of values using rule classes
Author: By
Last change:
Date: 1 year ago
Size: 552 bytes
 

Contents

Class file image Download
<?php
/*
 * Copyright (c) 2022. Wepesi validation.
 * @author Boss Ibrahim Mussa
 */
$validate = new \Wepesi\App\Validate();
$schema = new \Wepesi\App\Schema();

$data_source = [
   
'birth_day' => '2021-05-23',
   
'date_created' => '2021-05-23'
];
$rules=[
       
"birth_day" => $schema->date()->min("-18years")->required()->generate(),
       
"date_created" => $schema->date()->now()->max("100years")->required()->generate()
    ];
   
$validate->check($data_source,$rules);

   
var_dump($validate->passed());
   
var_dump($validate->errors());