PHP Classes

File: test/js/out.txt

Recommend this page to a friend!
  Classes of Nikos M.  >  Formal PHP Validation Library  >  test/js/out.txt  >  Download  
File: test/js/out.txt
Role: Documentation
Content type: text/plain
Description: Documentation
Class: Formal PHP Validation Library
Validate a set values with support to type casting
Author: By
Last change: v.1.2.0

* correctly handle (wildcard) missing keys in typecast/validate
* correctly handle some edge cases when input data is not array or object
* update tests
Date: 1 month ago
Size: 1,470 bytes
 

Contents

Class file image Download
Formal.VERSION 1.2.0
{
    "foo": "",
    "moo": [
        {
            "choo": 1
        },
        {
            "choo": 2
        },
        {
            "choo": 3
        }
    ],
    "soo": [
        {
            "boo": 1,
            "xoo": "a"
        },
        {
            "boo": 2,
            "xoo": "b"
        },
        {
            "boo": 3,
            "xoo": "c"
        }
    ],
    "koo": [
        "",
        "",
        ""
    ],
    "num": [
        "0.1",
        "1.2"
    ],
    "date": [
        "2012-11-02",
        "20-11-02"
    ]
}
{
    "foo": "bar",
    "moo": [
        {
            "choo": 1,
            "foo": "bar"
        },
        {
            "choo": 2,
            "foo": "bar"
        },
        {
            "choo": 3,
            "foo": "bar"
        }
    ],
    "soo": [
        {
            "boo": 1,
            "xoo": "a"
        },
        {
            "boo": 2,
            "xoo": "b"
        },
        {
            "boo": 3,
            "xoo": "c"
        }
    ],
    "koo": [
        "bar",
        "bar",
        "bar"
    ],
    "num": [
        0.1,
        1
    ],
    "date": [
        "2012-11-02",
        "20-11-02"
    ]
}
"foo.*" is required!
"foo.*.foo" is required!
"date.1" should match Y-m-d !
"date.0" must be equal to "date.1"!
2
[
    1,
    2,
    3
]
[
    1,
    "a",
    2,
    "b",
    3,
    "c"
]
"default"
[
    "default",
    "default",
    "default"
]
"default"
"default"
For more information send a message to info at phpclasses dot org.