Class Constructor
SmartyValidate
SmartyValidate
()
initialize the validator
void
connect
(obj &$smarty, [string $reset = false])
-
obj
$smarty: the smarty object
-
string
$reset: reset the default form?
clear the entire SmartyValidate session
void
disconnect
()
test if a criteria function is registered
void
is_registered_criteria
(mixed $name, [mixed $form = 'default'], string $var)
-
string
$var: the value being booleanized
test if the session data is initialized
void
is_registered_form
([string $form = 'default'])
-
string
$form: the name of the form being validated
register a callable function for form verification
void
is_registered_object
(mixed $object_name, string $func_name)
-
string
$func_name: the function being registered
test if a tranform function is registered
void
is_registered_transform
(mixed $name, [mixed $form = 'default'], string $var)
-
string
$var: the value being booleanized
test if a validator is registered
void
is_registered_validator
(string $id, [mixed $form = 'default'])
-
string
$id: the validator to test
validate the form
void
is_valid
(string &$formvars, [string $form = 'default'])
-
string
$formvars: the array of submitted for variables
-
string
$form: the name of the form being validated
test if object is a valid smarty object
void
is_valid_smarty_object
(obj &$smarty_obj)
-
obj
$smarty_obj: the smarty object
register a callable function for form verification
void
register_criteria
(mixed $name, string $func_name, [mixed $form = 'default'])
-
string
$func_name: the function being registered
initialize the session data
void
register_form
(string $form, [string $reset = false])
-
string
$form: the name of the form being validated
-
string
$reset: reset an already registered form?
register a callable function for form verification
void
register_object
(mixed $object_name, mixed &$object, string $func_name)
-
string
$func_name: the function being registered
register a callable function for form verification
void
register_transform
(mixed $name, string $func_name, [mixed $form = 'default'])
-
string
$func_name: the function being registered
register a validator
void
register_validator
(string $id, string $field, string $criteria, [string $empty = false], [string $halt = false], [string $transform = null], [string $form = 'default'])
-
string
$id: the id of the validator
-
string
$field: the field to be validated
-
string
$criteria: the name of the criteria function
-
string
$empty: allow field to be empty (optional)
-
string
$halt: stop validation if this one fails (optional)
-
string
$transform: transform function(s) to apply (optional)
-
string
$form: name of the form (optional)
set the current page of the form
void
set_page
(string $page, [string $form = 'default'])
-
string
$page: the name of the page being validated
-
string
$form: the name of the form being validated
register a validator
void
set_transform
(string $id, string $transform, [string $form = 'default'])
-
string
$id: the id of the validator
-
string
$transform: the name of the transform function(s)
-
string
$form: name of the form (optional)
unregister a form from the session
void
unregister_form
(string $form)
-
string
$form: the name of the form being validated
unregister a validator
void
unregister_validator
(string $id, [mixed $form = 'default'])
-
string
$id: the validator to unregister
booleanize a value
void
_booleanize
(string $var)
-
string
$var: the value being booleanized
return actual function name of registered func
void
_execute_transform
(string $name, mixed $value, mixed $params, mixed &$formvars, string $form, string $type)
-
string
$type: the type of func
-
string
$name: the registered name
-
string
$form: the form name
return actual function name of registered func
void
_get_registered_func_name
(string $type, string $name, string $form)
-
string
$type: the type of func
-
string
$name: the registered name
-
string
$form: the form name
validate criteria for given value
void
_is_valid_criteria
(string $criteria, string $value, string $empty, mixed &$params, mixed &$formvars, mixed $form)
-
string
$criteria: the criteria to test against
-
string
$value: the value being tested
-
string
$empty: skip empty values or not
get or set an object instance
void
&_object_instance
(string $name, object &$object)
-
string
$name: the object name
-
object
$object: the object being set
register a callable function for form verification
void
_register_function
(mixed $type, mixed $name, string $func_name, [mixed $form = 'default'])
-
string
$func_name: the function being registered
get or set the smarty object instance
void
_smarty_assign
([mixed $vars = array()], string $value)
-
string
$value: the value being tested