![]() HTML_Progress2 : The Definitive Guide
|
In the default error class HTML_Progress2_Error
there are two methods designed for use with generating error messages efficiently. To use them, you must set the options
message_callback
, and context_callback
.
The default message handling callback (HTML_Progress2_Error::_getErrorMessage
) get an array mapping error codes to error message templates, like so:
$messages = array( HTML_PROGRESS2_ERROR_UNKNOWN => 'unknown error', HTML_PROGRESS2_ERROR_INVALID_INPUT => 'invalid input, parameter #%paramnum% ' . '"%var%" was expecting ' . '"%expected%", instead got "%was%"' );
Basically, if a variable name is enclosed in percent signs (%), it will be replaced with the value passed in the associative array.
HTML_Progress2 : The Definitive Guide | v 2.1.0 : August 12, 2006 |