HTML_CSS : The Definitive Guide
|
There are two methods of HTML_CSS_Error designed for use with generating error messages efficiently. To use them, you must set the options below in the HTML_CSS class constructor (argument #2):
The default message handling callback (HTML_CSS_Error::_getErrorMessage) get an array mapping error codes to error message templates, like so:
$messages = array(
HTML_CSS_ERROR_UNKNOWN =>
'unknown error',
HTML_CSS_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_CSS : The Definitive Guide | v 1.0.0 : June 24, 2006 |