本文整理汇总了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;
}