Files
smarty/plugins/function.assign_debug_info.php

33 lines
955 B
PHP
Raw Normal View History

2002-01-31 20:49:40 +00:00
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* Type: function
* Name: assign_debug_info
* Purpose: assign debug info to the template
* -------------------------------------------------------------
*/
2002-02-20 22:24:32 +00:00
function smarty_function_assign_debug_info($params, &$smarty)
2002-01-31 20:49:40 +00:00
{
2002-02-20 22:24:32 +00:00
$assigned_vars = $smarty->_tpl_vars;
2002-01-31 20:49:40 +00:00
ksort($assigned_vars);
if (@is_array($smarty->_config[0])) {
2002-02-20 22:24:32 +00:00
$config_vars = $smarty->_config[0];
2002-01-31 20:49:40 +00:00
ksort($config_vars);
2002-02-20 22:24:32 +00:00
$smarty->assign("_debug_config_keys", array_keys($config_vars));
$smarty->assign("_debug_config_vals", array_values($config_vars));
2002-01-31 20:49:40 +00:00
}
2002-02-20 22:24:32 +00:00
$included_templates = $smarty->_smarty_debug_info;
2002-01-31 20:49:40 +00:00
2002-02-20 22:24:32 +00:00
$smarty->assign("_debug_keys", array_keys($assigned_vars));
$smarty->assign("_debug_vals", array_values($assigned_vars));
2002-01-31 20:49:40 +00:00
2002-02-20 22:24:32 +00:00
$smarty->assign("_debug_tpls", $included_templates);
2002-01-31 20:49:40 +00:00
}
/* vim: set expandtab: */
?>