edydeyemi/valid8ed

A simple-to-use, lightweight PHP Validation Class

Maintainers

Package info

github.com/Edydeyemi/valid8ed

pkg:composer/edydeyemi/valid8ed

Statistics

Installs: 88

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0 2024-08-27 19:49 UTC

This package is auto-updated.

Last update: 2026-03-01 00:58:23 UTC


README

A simple-to-use, lightweight PHP Validation Class

Each method requires at least two parameters-

  1. The name of the form field
  2. The value to be validated

All validation methods can be chained together i.e.

$v->setField('product_category', $product_cat_id)->required()->isNumeric()->notGreaterThan(10);

Errors are contained in the $error property.

Installation

With Composer

composer require Edydeyemi/valid8ed

//1. Create a new instance of the Class

$v = new Valid8ed(); //Create a new instance of the class

//2. Set a field as required

$v->setField('product_name', $_POST["product_name"])->required();

//3. Check for or output any errors in the validation object

print_r($v->errors);