Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

smarty_internal_compile_debug.php 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Smarty Internal Plugin Compile Debug
  4. * Compiles the {debug} tag.
  5. * It opens a window the the Smarty Debugging Console.
  6. *
  7. * @package Smarty
  8. * @subpackage Compiler
  9. * @author Uwe Tews
  10. */
  11. /**
  12. * Smarty Internal Plugin Compile Debug Class
  13. *
  14. * @package Smarty
  15. * @subpackage Compiler
  16. */
  17. class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase
  18. {
  19. /**
  20. * Compiles code for the {debug} tag
  21. *
  22. * @param array $args array with attributes from parser
  23. * @param object $compiler compiler object
  24. *
  25. * @return string compiled code
  26. */
  27. public function compile($args, $compiler)
  28. {
  29. // check and get attributes
  30. $_attr = $this->getAttributes($compiler, $args);
  31. // compile always as nocache
  32. $compiler->tag_nocache = true;
  33. // display debug template
  34. $_output = "<?php \$_smarty_debug = new Smarty_Internal_Debug;\n \$_smarty_debug->display_debug(\$_smarty_tpl);\n";
  35. $_output .= "unset(\$_smarty_debug);\n?>";
  36. return $_output;
  37. }
  38. }