Validator Class

By orqi

These are the Validating functions that are available to any class that extends the validator

IsValidAlphanumeric

function IsValidAlphanumeric($value);

Checks that the $value is a valid Integer

IsValidInt

function IsValidInt($value);

Checks that the $value is a valid Integer

IsValidBool

function IsValidBool($value);

Checks that the $value is a valid Boolean

IsValidEmail

function IsValidEmail($value);

Checks that the $value is a valid Email Address

IsValidDate

function IsValidDate($value);

Checks that the $value is a valid Date field

IsValidURL

function IsValidURL($value);

Checks that the $value is a valid URL

IsValidColour

function IsValidColour($value);

Checks that the $value is a valid hexidecimal colour value

IsValidDDMMYYYY

function IsValidDDMMYYYY($value);

Checks that the $value is a valid DD/MM/YYYY style date.

IsValidYYYYMMDD

function IsValidYYYYMMDD($value);

Checks that the $value is a valid YYYY/MM/DD style date.

AddErrorMessage

function AddErrorMessage($error_message='');

PrintError

function PrintError($error_name='');

Takes in an error name, looks for it in the errors array and if it’s there, wraps some HTML around it and returns.

PrintErrors

function PrintErrors();

Outputs all errors discovered by the Validator->isValid() function

Tags:

Leave a Reply