Smarty
[ class tree: Smarty ] [ index: Smarty ] [ all elements ]

Source for file function.var_dump.php

Documentation is available at function.var_dump.php

  1. <?php
  2. /**
  3.  * Smarty plugin
  4.  * @package Smarty
  5.  * @subpackage plugins
  6.  */
  7.  
  8. /** \file
  9.  * $Header$
  10.  *
  11.  * \author zaufi <zaufi@sendmail.ru>
  12.  */
  13.  
  14.  
  15. /**
  16.  * \brief Smarty plugin to add variable dump to debug console log
  17.  * Usage format {var_dump var=var_name_2_dump}
  18.  */
  19. function smarty_function_var_dump($params&$gBitSmarty)
  20. {
  21.   global $debugger;
  22.   require_onceDEBUG_PKG_PATH.'debugger.php' );
  23.   //
  24.   $v $params['var'];
  25.   if (strlen($v!= 0)
  26.   {
  27.     $tmp $gBitSmarty->get_template_vars();
  28.     if (is_array($tmp&& isset($tmp[$v]))
  29.       $debugger->msg("Smarty var_dump(".$v.') = '.print_r($tmp[$v]true));
  30.     else
  31.       $debugger->msg("Smarty var_dump(".$v."): Variable not found");
  32.   }
  33.   else
  34.     $debugger->msg("Smarty var_dump: Parameter 'var' not specified");
  35.   return '<!-- var_dump('.$v.') -->';
  36. }
  37.  
  38. ?>

Documentation generated on Wed, 29 Jul 2015 13:56:40 +0000 by phpDocumentor 1.5.0-lsces