Class SmartyValidate

Description

Project: SmartyValidate: Form Validator for the Smarty Template Engine

File: SmartyValidate.class.php Author: Monte Ohrt <monte at newdigitalgroup dot com> Website: http://www.phpinsider.com/php/code/SmartyValidate/

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Located in /karibou2/class/smarty/SmartyValidate/SmartyValidate.class.php (line 31)


	
			
Method Summary
SmartyValidate SmartyValidate ()
void connect (obj &$smarty, [string $reset = false])
void disconnect ()
void is_registered_criteria (mixed $name, [mixed $form = 'default'], string $var)
void is_registered_form ([string $form = 'default'])
void is_registered_object (mixed $object_name, string $func_name)
void is_registered_transform (mixed $name, [mixed $form = 'default'], string $var)
void is_registered_validator (string $id, [mixed $form = 'default'])
void is_valid (string &$formvars, [string $form = 'default'])
void is_valid_smarty_object (obj &$smarty_obj)
void register_criteria (mixed $name, string $func_name, [mixed $form = 'default'])
void register_form (string $form, [string $reset = false])
void register_object (mixed $object_name, mixed &$object, string $func_name)
void register_transform (mixed $name, string $func_name, [mixed $form = 'default'])
void register_validator (string $id, string $field, string $criteria, [string $empty = false], [string $halt = false], [string $transform = null], [string $form = 'default'])
void set_page (string $page, [string $form = 'default'])
void set_transform (string $id, string $transform, [string $form = 'default'])
void unregister_form (string $form)
void unregister_validator (string $id, [mixed $form = 'default'])
void _booleanize (string $var)
void _execute_transform (string $name, mixed $value, mixed $params, mixed &$formvars, string $form, string $type)
void _get_registered_func_name (string $type, string $name, string $form)
void _is_valid_criteria (string $criteria, string $value, string $empty, mixed &$params, mixed &$formvars, mixed $form)
void &_object_instance (string $name, object &$object)
void _register_function (mixed $type, mixed $name, string $func_name, [mixed $form = 'default'])
void _smarty_assign ([mixed $vars = array()], string $value)
Methods
Constructor SmartyValidate (line 36)

Class Constructor

SmartyValidate SmartyValidate ()
connect (line 45)

initialize the validator

void connect (obj &$smarty, [string $reset = false])
  • obj $smarty: the smarty object
  • string $reset: reset the default form?
disconnect (line 69)

clear the entire SmartyValidate session

void disconnect ()
is_registered_criteria (line 323)

test if a criteria function is registered

void is_registered_criteria (mixed $name, [mixed $form = 'default'], string $var)
  • string $var: the value being booleanized
is_registered_form (line 109)

test if the session data is initialized

void is_registered_form ([string $form = 'default'])
  • string $form: the name of the form being validated
is_registered_object (line 295)

register a callable function for form verification

void is_registered_object (mixed $object_name, string $func_name)
  • string $func_name: the function being registered
is_registered_transform (line 336)

test if a tranform function is registered

void is_registered_transform (mixed $name, [mixed $form = 'default'], string $var)
  • string $var: the value being booleanized
is_registered_validator (line 408)

test if a validator is registered

void is_registered_validator (string $id, [mixed $form = 'default'])
  • string $id: the validator to test
is_valid (line 119)

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
is_valid_smarty_object (line 60)

test if object is a valid smarty object

void is_valid_smarty_object (obj &$smarty_obj)
  • obj $smarty_obj: the smarty object
register_criteria (line 305)

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
register_form (line 80)

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_object (line 282)

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_transform (line 314)

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_validator (line 355)

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_page (line 449)

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
set_transform (line 392)

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_form (line 100)

unregister a form from the session

void unregister_form (string $form)
  • string $form: the name of the form being validated
unregister_validator (line 428)

unregister a validator

void unregister_validator (string $id, [mixed $form = 'default'])
  • string $id: the validator to unregister
_booleanize (line 548)

booleanize a value

void _booleanize (string $var)
  • string $var: the value being booleanized
_execute_transform (line 462)

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
_get_registered_func_name (line 536)

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
_is_valid_criteria (line 562)

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
_object_instance (line 599)

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_function (line 499)

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
_smarty_assign (line 622)

get or set the smarty object instance

void _smarty_assign ([mixed $vars = array()], string $value)
  • string $value: the value being tested

Documentation generated on Sat, 17 Feb 2007 02:55:19 +0100 by phpDocumentor 1.3.0RC3