[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/validation/src/ -> lmbErrorList.class.php (summary)

(no description)

File Size: 116 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

lmbErrorList:: (5 methods):
  setFieldNameDictionary()
  addError()
  getFieldName()
  isValid()
  getReadable()


Class: lmbErrorList  - X-Ref

Holds a list of validation errors

setFieldNameDictionary($dictionary)   X-Ref
Sets new field name dictionary
Usually this happens in {@link WactFormComponent :: setErrors()}

param: mixed New field name dictionary object.
return: void

addError($message, $fields = array()   X-Ref
Adds new error.
Creates an object of {@link lmbErrorMessage} class.
Accepts error message, array of fields list which this error is belong to and array of values.
Error message can contain placeholders like {Placeholder} that will be replaced with field names
and values in {@link lmbErrorMessage :: getReadableErrorList()}
Here is an example of adding error to error list in some validation rule:
<code>
$error_list->addError('{Field} must contain at least {min} characters.', array('Field' => 'password'), array('min' => 5));
</code>
After all replacements we can get something like "Password must contain at least 5 characters", there "password" becomes "Password"

param: string Error message with placeholders like {Field} must contain at least {min} characters.
param: array Array of aliases and field names like array('BaseField' => 'password', 'RepeatField' => 'repeat_password')
param: array Array of aliases and field values like array('Min' => 5, 'Max' => 15)
return: lmbErrorMessage

getFieldName($field)   X-Ref
Returns humal readable name of a field
Actually delegates to field name dictionary

param: string
return: string

isValid()   X-Ref
Returns FALSE is contains at least one error, otherwise returns TRUE

return: boolean

getReadable()   X-Ref
Return processed error list with translated and formatted messages

return: string



Generated: Tue Oct 14 04:47:40 2008 Cross-referenced by PHPXref 0.7