Source for file modifier.debug_print_var.php
Documentation is available at modifier.debug_print_var.php
* Smarty debug_print_var modifier plugin
* Name: debug_print_var<br>
* Purpose: formats variable contents for display in the console
* @link http://smarty.php.net/manual/en/language.modifier.debug.print.var.php
* debug_print_var (Smarty online manual)
$_replace = array ("\n"=> '<i>\n</i>', "\r"=> '<i>\r</i>', "\t"=> '<i>\t</i>');
$results = "<b>Array (". count($var). ")</b>";
foreach ($var as $curr_key => $curr_val) {
$results .= "<br>". str_repeat(' ', $depth*2 ). "<b>". strtr($curr_key, $_replace)." </b> => $return";
$results = "<b>". get_class($var). " Object (". count($object_vars). ")</b>";
foreach ($object_vars as $curr_key => $curr_val) {
$results .= "<br>". str_repeat(' ', $depth*2 )." <b>$curr_key</b> => $return";
if (empty ($var) && $var != "0") {
if (strlen($var) > $length ) {
$results = substr($var, 0 , $length-3 ). '...';
$results = strtr($results, $_replace);
/* vim: set expandtab: */
Documentation generated on Mon, 25 Jun 2007 14:03:30 -0400 by phpDocumentor 1.3.2. PEAR Logo Copyright © PHP Group 2004.
|