Download the PHP package openlss/lib-validate without Composer
On this page you can find all versions of the php package openlss/lib-validate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download openlss/lib-validate
More information about openlss/lib-validate
Files in openlss/lib-validate
Package lib-validate
Short Description Validation helper with a shorthand syntax.
License LGPL-3.0+
Homepage http://openlss.org
Informations about the package lib-validate
openlss/lib-validate
Validation helper with a shorthand syntax.
Usage
Types
All these types will evaluate to true IF:
- blank '' === true
- empty empty() === true
- null is_null($var)
- ip var is IPv4 octect format
- mac True if var is in mac address format (loose check for chars)
- domain True if var is a domain name (loose check for chars)
- num True if var is all numeric
- dec True if the var is numeric with a decimal point
- float Same as dec
- alpha True if all characters are alpha-numeric
- al Same as alpha
- alu Same as alpha but with underscores (_)
- als True if var is alphanumeric with spaces
- alnums Alias to als
- en Alias to als
- email True if chars are valid for an email address
- sha1 True if var is a sha1 hash
- md5 True of var is a md5 hash
Reference
(void) Validate::prime($data)
Prep validate with an array of data usualy from post()
(object) Validate::go($var)
Starts a validation object for the given param
(object) Validate::_get()
Returns the current instance
(object) Validate::error($err)
Add error message to buffer This is generally used internally
(object) Validate::setVar($var)
Sets the var to operate on This is generally used internally
(string) Validate::get()
Retrieves the current variable This is generally used internally
(object) Validate::min($min)
Checks that the current var is at minimum $min long
(object) Validate::max($max)
Checks that the current var is at maximum $max long
(object) Validate::not($type)
Checks that the current var is not given $type
(object) Validate::is($type)
Checks that the current var is given #type
(bool) Validate::paint()
If there are any errors in the buffer an exception will be raised Otherwise TRUE is returned