$length is now propagated to sub-values in debug_print_var

This commit is contained in:
messju
2003-03-27 22:10:00 +00:00
parent 65985aa4a5
commit e90a98451f
2 changed files with 4 additions and 2 deletions

2
NEWS
View File

@@ -1,3 +1,5 @@
- $length is now propagated to sub-values in debug_print_var (messju)
Version 2.5.0-RC2 (March 26, 2003) Version 2.5.0-RC2 (March 26, 2003)
---------------------------------- ----------------------------------

View File

@@ -13,7 +13,7 @@ function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
if (is_array($var)) { if (is_array($var)) {
$results = "<b>Array (".count($var).")</b>"; $results = "<b>Array (".count($var).")</b>";
foreach ($var as $curr_key => $curr_val) { foreach ($var as $curr_key => $curr_val) {
$return = smarty_modifier_debug_print_var($curr_val, $depth+1); $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length);
$results .= '<br>\r'.str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return"; $results .= '<br>\r'.str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return";
} }
return $results; return $results;
@@ -21,7 +21,7 @@ function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
$object_vars = get_object_vars($var); $object_vars = get_object_vars($var);
$results = "<b>".get_class($var)." Object (".count($object_vars).")</b>"; $results = "<b>".get_class($var)." Object (".count($object_vars).")</b>";
foreach ($object_vars as $curr_key => $curr_val) { foreach ($object_vars as $curr_key => $curr_val) {
$return = smarty_modifier_debug_print_var($curr_val, $depth+1); $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length);
$results .= '<br>\r'.str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return"; $results .= '<br>\r'.str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return";
} }
return $results; return $results;