JError/handleMessage: Difference between revisions
From Joomla! Documentation
m clean up |
m preparing for archive only |
||
| Line 49: | Line 49: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=handleMessage | category=handleMessage | ||
category=JError | category=JError | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
Latest revision as of 01:36, 25 March 2017
Description
Message error handler Enqueues the error message into the system queue
<! removed transcluded page call, red link never existed >
Syntax
static handleMessage(&$error, $options)
| Parameter Name | Default Value | Description |
|---|---|---|
| &$error | $error object to handle | |
| $options | $options Handler options |
Returns
object The exception object
Defined in
libraries/joomla/error/error.php
Importing
jimport( 'joomla.error.error' );
Source Body
public static function handleMessage(& $error, $options)
{
$appl = JFactory::getApplication();
$type = ($error->get('level') == E_NOTICE) ? 'notice' : 'error';
$appl->enqueueMessage($error->get('message'), $type);
return $error;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples