cvs: smarty / NEWS debug.tpl /plugins modifier.debug_print_var.php

From: Date: Wed, 24 Jul 2002 13:21:51 +0000
Subject: cvs: smarty / NEWS debug.tpl /plugins modifier.debug_print_var.php
Groups: php.smarty.cvs 
Request: Send a blank email to php-smarty-cvs+get-211@lists.php.net to get a copy of this message
mohrt Wed Jul 24 09:21:51 2002 EDT Modified files: /smarty NEWS debug.tpl /smarty/plugins modifier.debug_print_var.php Log: update debug console to show objects, fix warning in debug.tpl Index: smarty/NEWS diff -u smarty/NEWS:1.222 smarty/NEWS:1.223 --- smarty/NEWS:1.222 Tue Jul 23 09:39:59 2002 +++ smarty/NEWS Wed Jul 24 09:21:51 2002 @@ -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) Index: smarty/debug.tpl diff -u smarty/debug.tpl:1.2 smarty/debug.tpl:1.3 --- smarty/debug.tpl:1.2 Tue Jul 16 11:04:01 2002 +++ smarty/debug.tpl Wed Jul 24 09:21:51 2002 @@ -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> Index: smarty/plugins/modifier.debug_print_var.php diff -u smarty/plugins/modifier.debug_print_var.php:1.2 smarty/plugins/modifier.debug_print_var.php:1.3 --- smarty/plugins/modifier.debug_print_var.php:1.2 Fri Feb 15 15:50:44 2002 +++ smarty/plugins/modifier.debug_print_var.php Wed Jul 24 09:21:51 2002 @@ -17,6 +17,14 @@ $results .= '<br>\r'.str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $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('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return"; + } + return $results; } else { if (empty($var) && $var != "0") { return '<i>empty</i>';

« previous php.smarty.cvs (#211) next »