Validate Class
Utilities to help sanitize data. Located in the namespace Canteen\Utilities.
Item Index
Methods
- verify static
- verifyMutli static
Methods
verify
(
Mixed
static
-
data
-
[type=null]
-
[suppressErrors=false]
Sanitize input data using the validation types above
Parameters:
Returns:
Mixed:
If we don't verify and suppress errors, returns false, else returns the data
verifyMutli
(
Mixed
static
-
data
-
types
-
[suppressErrors=false]
Verify multiple data with multiple types
Parameters:
Returns:
Mixed:
False if anything doesn't verify or else returns data
Properties
ALPHA_NUMERIC
RegExp
final
static
Validation Type: remove all non alpha numeric characters, includes a-z, A-Z, 0-9
EMAIL
RegExp
final
static
Validation Type: remove all non email characters, includes a-z, A-Z, 0-9, ., -, _, @
SEARCH
RegExp
final
static
Validation Type: remove all non search characters, includes a-z, A-Z, 0-9, space
URI
RegExp
final
static
Validation Type: remove all non standard uri characters, includes a-z, A-Z, 0-9, -, _, ., /
URL
RegExp
final
static
Validation Type: remove all non standard URL characters, includes a-z, A-Z, 0-9, -, _, ., /, &, %, :, =