Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/litto/validator
Validating Class for Form submissions
https://github.com/litto/validator
Last synced: about 2 months ago
JSON representation
Validating Class for Form submissions
- Host: GitHub
- URL: https://github.com/litto/validator
- Owner: litto
- License: mit
- Created: 2022-02-07T06:37:12.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-07T06:44:50.000Z (almost 3 years ago)
- Last Synced: 2024-05-03T21:20:26.336Z (8 months ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Validator class
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