All Projects → siriusphp → Validation

siriusphp / Validation

Licence: mit
Framework agnostic validation library for PHP

Projects that are alternatives of or similar to Validation

Awesomevalidation
Android validation library which helps developer boil down the tedious work to three easy steps.
Stars: ✭ 1,093 (+648.63%)
Mutual labels:  validation, forms, input
Vue Formulate
⚡️ The easiest way to build forms with Vue.
Stars: ✭ 1,947 (+1233.56%)
Mutual labels:  validation, forms, input
Formik Alicante
Formik slides & demos from React Alicante
Stars: ✭ 47 (-67.81%)
Mutual labels:  validation, forms
Autosize Input
🎈 Effortless, dynamic-width text boxes in vanilla JavaScript
Stars: ✭ 64 (-56.16%)
Mutual labels:  forms, input
Form Object
Form object to use with Vue components for sending data to a Laravel application using axios.
Stars: ✭ 73 (-50%)
Mutual labels:  validation, forms
React Final Form
🏁 High performance subscription-based form state management for React
Stars: ✭ 6,781 (+4544.52%)
Mutual labels:  validation, forms
Form Js
Easily create web forms. Supports Meteor, AngularJS, React, Polymer and any CSS library, e.g. Bootstrap.
Stars: ✭ 9 (-93.84%)
Mutual labels:  forms, input
Customui
Library to create custom UI's in MCPE 1.2+
Stars: ✭ 60 (-58.9%)
Mutual labels:  forms, input
Wtforms
A flexible forms validation and rendering library for Python.
Stars: ✭ 1,214 (+731.51%)
Mutual labels:  validation, forms
React Inform
Simple controlled forms with validations in react
Stars: ✭ 81 (-44.52%)
Mutual labels:  validation, forms
React Native Merlin
🧙 Simple web-like forms in react native.
Stars: ✭ 83 (-43.15%)
Mutual labels:  validation, forms
Winterfell
Generate complex, validated and extendable JSON-based forms in React.
Stars: ✭ 787 (+439.04%)
Mutual labels:  validation, forms
Hyperform
Capture form validation back from the browser
Stars: ✭ 729 (+399.32%)
Mutual labels:  validation, input
Usetheform
React library for composing declarative forms, manage their state, handling their validation and much more.
Stars: ✭ 40 (-72.6%)
Mutual labels:  validation, forms
Intl Tel Input
A JavaScript plugin for entering and validating international telephone numbers
Stars: ✭ 5,963 (+3984.25%)
Mutual labels:  validation, input
Typesystem
Data validation, serialization, deserialization & form rendering. 🔢
Stars: ✭ 416 (+184.93%)
Mutual labels:  validation, forms
React Hook Form
📋 React Hooks for form state management and validation (Web + React Native)
Stars: ✭ 24,831 (+16907.53%)
Mutual labels:  validation, forms
Colander
A serialization/deserialization/validation library for strings, mappings and lists.
Stars: ✭ 408 (+179.45%)
Mutual labels:  validation, forms
Laravel Multistep Forms
Responsable Multistep Form Builder for Laravel
Stars: ✭ 76 (-47.95%)
Mutual labels:  validation, forms
Play2 Html5tags
HTML5 form tags module for Play Framework
Stars: ✭ 101 (-30.82%)
Mutual labels:  validation, forms

Sirius Validation

Source Code Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

Sirius Validation is a library for data validation. It offers:

  1. validator object
  2. 45 build-in validation rules. There are validators for strings, array, numbers, emails, URLs, files and uploads
  3. validation helper to simplify the validation of single values

Out-of-the-box, the library can handle arrays, ArrayObjects and objects that have implemented the toArray method. In order to validate other data containers you must create a DataWrapper so that the validator be able to extract data from your object.

Elevator pitch

$validator = new \Sirius\Validation\Validator;

// add a validation rule
$validator->add('title', 'required');

// add a rule that has a list of options
$validator->add('title', 'length', array('min' => 10, 'max' => 100));
// or use JSON
$validator->add('title', 'length', '{"min": 10, "max": 100}');
// or a URL query string
$validator->add('title', 'length', 'min=10&max=100');
// or, if you know that the validator can CORECTLY parse (ie: understand) the options string
$validator->add('title', 'length', '10,100');

// add a rule with a custom error message
$validator->add('title', 'maxlength', 'max=100', 'Article title must have less than {max} characters');

// add a rule with a custom message and a label (very handy with forms)
$validator->add('title:Title', 'maxlength', 'max=100', '{label} must have less than {max} characters');

// add multiple rules at once (separate using [space][pipe][space])
$validator->add('title:Title', 'required | maxlength(255) | minlength(min=10)');

// add all your rules at once
$validator->add([
        'title:Title' => 'required | maxlength(100)',
        'content:Content' => 'required',
        'source:Source' => 'website'
    ], [
        'content.required' => 'The content field should have a velue'
    ]);

// add nested rules
$validator->add('recipients[*]:Recipients', 'email'); //all recipients must be valid email addresses
$validator->add('shipping_address[city]:City', 'MyApp\Validator\City'); // uses a custom validator to validate the shipping city

Links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].