litto/validator

Class validator for Form Submissions

Installs: 9

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/litto/validator

v1.0 2022-02-07 06:44 UTC

This package is auto-updated.

Last update: 2026-01-07 18:47:46 UTC


README

Validating Class for Form submissions

##How to Install?

You can install the package using composer by typing the command

composer require litto/validator:v1.0

##How it Works?

$rules = array( "firstName"=>"LABEL1/EMPTY", "lastName"=>"LABEL2/EMPTY", "email"=>"LABEL3/EMAIL|EMPTY", "website"=>"LABEL4/URL", "price"=>"LABEL5/NUMBER|EMPTY", ); $obj = new Validator($rules); if($obj -> validate()){ echo "Validation Success"; }else{ echo $obj->getMessage(); }

After Form submission, just initialise the validator class and pass the validate rules