HTML_CSS : The Definitive Guide
|
Table of Contents
The HTML_CSS package is implemented with a flexible error handler plug-in system. You may use any error handler that you want. Using
PEAR_Error object (default), but also the
PEAR_ErrorStack package, or any other error handler you might want to plug in.
Without any configuration, each HTML_CSS API error (basic or exception) will raise a
HTML_CSS_Error object that will be return to call script (user script).
![]() |
Tip |
|---|---|
Easy to distinct basic PEAR_Error from other PEAR packages to HTML_CSS errors, even if there is a better and more robust solution:
HTML_CSS::isError(). But also provide a unique way to retrieve the level of error (warning, error, exception) with the
HTML_CSS_Error::getLevel() method.
|
As usual you can use the PEAR error API as well.
<?php
require_once 'HTML/CSS.php';
$css = new HTML_CSS();
$result = $css->setStyle('div', 'color', 5);
if (PEAR::isError($result)) {
// do something when an error is raised
}
?>
and output to screen will give something like :
Perhaps this standard behavior is not what you want. Don't worry, you can change everything :
![]() |
Important |
|---|---|
| HTML_CSS obey at display_errors and log_errors protocol |
| HTML_CSS : The Definitive Guide | v 1.0.0 : June 24, 2006 |