library/smarty/libs/sysplugins/smarty_internal_compile_debug.php
changeset 46 f11c31f7fa3e
parent 45 a56e7f9a0463
child 47 03388ec805b4
equal deleted inserted replaced
45:a56e7f9a0463 46:f11c31f7fa3e
     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 /**
       
    13  * Smarty Internal Plugin Compile Debug Class
       
    14  *
       
    15  * @package    Smarty
       
    16  * @subpackage Compiler
       
    17  */
       
    18 class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase {
       
    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         // check and get attributes
       
    29         $_attr = $this->getAttributes($compiler, $args);
       
    30 
       
    31         // compile always as nocache
       
    32         $compiler->tag_nocache = true;
       
    33 
       
    34         // display debug template
       
    35         $_output = "<?php \$_smarty_tpl->smarty->loadPlugin('Smarty_Internal_Debug'); Smarty_Internal_Debug::display_debug(\$_smarty_tpl); ?>";
       
    36 
       
    37         return $_output;
       
    38     }
       
    39 }