henningcullin / php-form-validation
Lightweight PHP form validation library inspired by Fomantic UI.
Package info
github.com/henningcullin/php-form-validation
pkg:composer/henningcullin/php-form-validation
v0.1.0
2025-10-14 19:11 UTC
Requires
- php: >=8.1
This package is auto-updated.
Last update: 2026-03-14 20:15:40 UTC
README
Lightweight PHP form validation library inspired by Fomantic UI.
Supports fields, rules, custom validation, and JSON export.
⚠️ Warning: This library is in early development (pre-1.0).
APIs and behavior may change without notice. Use at your own risk.
Installation
Using composer:
composer require henningcullin/php-form-validation
Usage
require 'vendor/autoload.php'; use FormValidation\Schema; use FormValidation\Field; use FormValidation\Rules\RuleEmail; $field = Field::new('email') ->add_rule(RuleEmail::new('Invalid email')); $schema = Schema::new() ->add_field($field); $data = ['email' => 'test@example.com']; $result = $schema->validate($data); if ($result->is_ok()) { echo "All good!"; } else { print_r($result->get_errors()); }