mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 02:14:26 +02:00
update debug console to show objects, fix warning in debug.tpl
This commit is contained in:
2
NEWS
2
NEWS
@@ -1,3 +1,5 @@
|
||||
- update debug console to print objects (Simon Willison,
|
||||
Monte)
|
||||
- fix Config_File class to not error when there are no
|
||||
sections (Peter Kmet, Monte)
|
||||
- add default modifier logic (Monte)
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
{assign_debug_info}
|
||||
|
||||
{if $_smarty_debug_output eq "html"}
|
||||
{if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"}
|
||||
<HTML><TITLE>Smarty Debug Console_"+self.name+"</TITLE><BODY bgcolor=#ffffff>
|
||||
<table border=0 width=100%>
|
||||
<tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr>
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
{assign_debug_info}
|
||||
|
||||
{if $_smarty_debug_output eq "html"}
|
||||
{if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"}
|
||||
<HTML><TITLE>Smarty Debug Console_"+self.name+"</TITLE><BODY bgcolor=#ffffff>
|
||||
<table border=0 width=100%>
|
||||
<tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr>
|
||||
|
@@ -17,6 +17,14 @@ function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
|
||||
$results .= '<br>\r'.str_repeat(' ', $depth*2)."<b>$curr_key</b> => $return";
|
||||
}
|
||||
return $results;
|
||||
} else if (is_object($var)) {
|
||||
$object_vars = get_object_vars($var);
|
||||
$results = "<b>".get_class($var)." Object (".count($object_vars).")</b>";
|
||||
foreach ($object_vars as $curr_key => $curr_val) {
|
||||
$return = smarty_modifier_debug_print_var($curr_val, $depth+1);
|
||||
$results .= '<br>\r'.str_repeat(' ', $depth*2)."<b>$curr_key</b> => $return";
|
||||
}
|
||||
return $results;
|
||||
} else {
|
||||
if (empty($var) && $var != "0") {
|
||||
return '<i>empty</i>';
|
||||
|
@@ -17,6 +17,14 @@ function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
|
||||
$results .= '<br>\r'.str_repeat(' ', $depth*2)."<b>$curr_key</b> => $return";
|
||||
}
|
||||
return $results;
|
||||
} else if (is_object($var)) {
|
||||
$object_vars = get_object_vars($var);
|
||||
$results = "<b>".get_class($var)." Object (".count($object_vars).")</b>";
|
||||
foreach ($object_vars as $curr_key => $curr_val) {
|
||||
$return = smarty_modifier_debug_print_var($curr_val, $depth+1);
|
||||
$results .= '<br>\r'.str_repeat(' ', $depth*2)."<b>$curr_key</b> => $return";
|
||||
}
|
||||
return $results;
|
||||
} else {
|
||||
if (empty($var) && $var != "0") {
|
||||
return '<i>empty</i>';
|
||||
|
Reference in New Issue
Block a user