previousconstructor PEAR_ErrorStack::PEAR_ErrorStack (Previous) (Next) PEAR_ErrorStack::getErrorMessageTemplatenext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

PEAR_ErrorStack::getErrorMessage

PEAR_ErrorStack::getErrorMessage() – Standard error message generation callback

Synopsis

require_once 'PEAR/ErrorStack.php';

string PEAR_ErrorStack::getErrorMessage ( PEAR_ErrorStack &$stack , array $err , string|false $template = false )

Description

This method may also be called by a custom error message generator to fill in template values from the params array, simply set the third parameter to the error message template string to use

The special variable %__msg% is reserved: use it only to specify where a message passed in by the user should be placed in the template, like so:

Error message: %msg% - internal error

If the message passed like so:

<?php
$stack->
push
(ERROR_CODE, 'error', array(), 'server error 500');
?>

The returned error message will be "Error message: server error 500 - internal error"

Parameter

PEAR_ErrorStack &$stack

array $err

string|false $template

Pre-generated error message template

Throws

throws no exceptions thrown

Note

This function should be called statically.

previousconstructor PEAR_ErrorStack::PEAR_ErrorStack (Previous) (Next) PEAR_ErrorStack::getErrorMessageTemplatenext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.