サンプルコード
/**
*
* @author Branko Ajzele
* @license GPL
*
* @param object $var Object we wish to debug in FireBug
* @param string $label Nice little label we wish to add so we can see it in FireBug
* @param string $style String holding one of values: ‘LOG’, ‘INFO’, ‘WARN’, ‘ERROR’, ‘TRACE’, ‘EXCEPTION’, ‘TABLE’
* @return void Return null if Mage::setIsDeveloperMode(false) otherwise return message to browser
*/
function acl($var, $label, $style = ‘LOG’)
{
if(Mage::getIsDeveloperMode())
{
$request = new Zend_Controller_Request_Http();
$response = new Zend_Controller_Response_Http();
$channel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
$channel->setRequest($request);
$channel->setResponse($response);
/*
* Start output buffering
*/
ob_start();
Zend_Wildfire_Plugin_FirePhp::send($var, $label, $style);
/*
Style Description
LOG Displays a plain log message
INFO Displays an info log message
WARN Displays a warning log message
ERROR Displays an error log message that increments Firebug’s error count
TRACE Displays a log message with an expandable stack trace
EXCEPTION Displays an error long message with an expandable stack trace
TABLE Displays a log message with an expandable table
*/
/*
* Flush log data to browser
*/
$channel->flush();
$response->sendHeaders();
}
else
{
return null;
}
}
acl($this->debug(), ‘Product view page aka view.phtml VAR: $this’);
または
acl($_product->debug(), ‘Product view page aka view.phtml VAR: $_product’);
この記事にはトラックバック・コメントがありません。
サイト管理者はコメントに関する責任を負いません。