本文整理匯總了PHP中Smarty_Internal_Debug::get_debug_vars方法的典型用法代碼示例。如果您正苦於以下問題:PHP Smarty_Internal_Debug::get_debug_vars方法的具體用法?PHP Smarty_Internal_Debug::get_debug_vars怎麽用?PHP Smarty_Internal_Debug::get_debug_vars使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Smarty_Internal_Debug
的用法示例。
在下文中一共展示了Smarty_Internal_Debug::get_debug_vars方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: smartyDebug
function smartyDebug()
{
if (!defined('Smarty::SMARTY_VERSION')) {
return;
}
$c = Ethna_Controller::getInstance();
$debug_tpl = $c->getDirectory('template') . "/smarty_debug.tpl";
//if smarty2
//if (!file_exists($debug_tpl)) {
// Ethna::raiseWarning(sprintf("Smarty debug template not found, please set %s.", $debug_tpl), E_USER_WARNING);
// return null;
//}
require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_debug.php';
// get template directory
$r = $c->getRenderer();
$smarty = $r->getEngine();
$vars = Smarty_Internal_Debug::get_debug_vars($smarty);
//$smarty_original_debugging = $smarty->debugging;
//$smarty_original_debugtpl = $smarty->debug_tpl;
//$smarty->debugging = true;
//$smarty->debug_tpl = $debug_tpl;
//$smarty->assign('_smarty_debug_output', 'html');
echo '<div class="ethna-debug" id="ethna-debug-smartydebugwindow">';
echo '<div class="ethna-debug-title">SmartyDebug</div>';
echo '<div class="ethna-debug-subtitle">Smarty template vars</div>';
echo "<div class=\"ethna-debug-log\">";
foreach ($vars->tpl_vars as $k => $v) {
$v = array($k => $v->value);
self::dumpArray($v);
}
echo "</div> \n";
echo '<div class="ethna-debug-subtitle">Smarty config vars</div>';
echo "<div class=\"ethna-debug-log\">";
foreach ($vars->config_vars as $k => $v) {
$v = array($k => $v->value);
self::dumpArray($v);
//self::dumpArray($v->value);
}
echo "</div> \n";
echo "</div> \n";
echo '</div>';
//$smarty->debugging = $smarty_original_debugging;
//$smarty->debug_tpl = $smarty_original_debugtpl;
}