PHP Classes

Input Validator: Validate of nested arrays using XML schema rules

Recommend this page to a friend!
  Info   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 414 This week: 2All time: 6,451 This week: 96Up
Version License PHP version Categories
nestedarrayvalidator 0.1MIT/X Consortium ...5.0XML, PHP 5, Validation
Description 

Author

This class can validate of nested arrays using XML schema rules.

It can take an example of associative array with valid values and converts it internally to validation rules defined in XML Schema Definitions (XSD).

An actual array of data, which can eventually be the $_POST request values, can be validated with the rules determined from the sample data.

It can also generate a XML Schema Definition file that can be edited separately to add more complex validation rules. The edited XSD file or string can also be used as input to define the validation rules.

The class supports validating values of different types, such as: boolean, integer, float, string, date, time, timestamp, array, object.

Innovation Award
PHP Programming Innovation award nominee
June 2012
Number 4


Prize: One downloadable copy of PhpED Professional
XML Schema (XSD) is a standard for defining rules that XML element values should follow.

This class can validate arrays of values, submitted eventually using Web forms, using rules defined using XML Schema.

It can validate not only all basic types of values but also more complex element types defined as nested arrays.

The initial set of validation rules can be generated from a sample array of valid values that is passed to the class.

This way the class makes it easy to get started defining basic validation rules without requiring to learn too much about XML Schema.

Manuel Lemos
Picture of Tom Schaefer
  Performance   Level  
Name: Tom Schaefer is available for providing paid consulting. Contact Tom Schaefer .
Classes: 39 packages by
Country: Germany Germany
Age: ???
All time rank: 1088 in Germany Germany
Week rank: 34 Up2 in Germany Germany Up
Innovation award
Innovation award
Nominee: 9x

Winner: 1x

  Files folder image Files  
File Role Description
Accessible without login Plain text file error_sample2.php Example error: unexpected type
Accessible without login Plain text file error_sample.php Example error: wrong type, expecting boolean, receiving integer
Accessible without login Plain text file error_sample3.php Example undefined key-value pair
Plain text file InputValidator.php Class class
Accessible without login Plain text file sample.php Example interface error sample
Accessible without login Plain text file sample2.php Example json to xsd using trang

 Version Control Unique User Downloads Download Rankings  
 0%
Total:414
This week:2
All time:6,451
This week:96Up