API16

JError/registerErrorLevel

From Joomla! Documentation

< API16:JError
Revision as of 17:44, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Method to register a new error level for handling errors <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JError/registerErrorLevel|...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Method to register a new error level for handling errors

[Edit Descripton]

Template:Description:JError/registerErrorLevel

Syntax[edit]

static registerErrorLevel($level, $name, $handler= 'ignore')
Parameter Name Default Value Description
$level $level Error level to register
$name $name Human readable name for the error level
$handler 'ignore' $handler Error handler to set for the new error level [optional]

Returns[edit]

boolean True on success; false if the level already has been registered

Defined in[edit]

libraries/joomla/error/error.php

Importing[edit]

jimport( 'joomla.error.error' );

Source Body[edit]

public static function registerErrorLevel($level, $name, $handler = 'ignore')
{
        if (isset(JError::$levels[$level])) {
                return false;
        }
        JError::$levels[$level] = $name;
        JError::setErrorHandling($level, $handler);
        return true;
}

[Edit See Also] Template:SeeAlso:JError/registerErrorLevel

Examples[edit]

<CodeExamplesForm />