| [ Index ] |
PHP Cross Reference of Limb3 |
[Source view] [Print] [Project Stats]
A base class for rules responsbile for validating a single field should inherit this class.
| Version: | $Id: lmbSingleFieldRule.class.php 5945 2007-06-06 08:31:43Z pachanga $ |
| File Size: | 89 lines (3 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| __construct($field_name, $custom_error = '') X-Ref |
param: string Field name |
| getField() X-Ref |
return: string Field name |
| error($message, $values = array() X-Ref |
| Alias for adding single field error to error list Fills field array with array('Field' => $this->field_name) that is ok for single field rules If $custom_error attribute is set will use $custom_error regardless of $message If $custom_error attribute is not set will apply lmb_i18n function to $message param: string Error message param: array Array of values return: void |
| validate($datasource, $error_list) X-Ref |
| Validates field Calls {@link check()} method if $datasource has such field with not empty value. Child classes must implement check($value) method to perform real validation. To check field for existance and having none empty value use {@link lmbRequiredRule} Fills {@link $error_list} |
| Generated: Sun Oct 12 04:41:30 2008 | Cross-referenced by PHPXref 0.7 |