]> git.mxchange.org Git - friendica.git/blob - vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_debug.php
Add Smarty to Composer
[friendica.git] / vendor / smarty / smarty / libs / sysplugins / smarty_internal_compile_debug.php
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     /**
21      * Compiles code for the {debug} tag
22      *
23      * @param  array  $args     array with attributes from parser
24      * @param  object $compiler compiler object
25      *
26      * @return string compiled code
27      */
28     public function compile($args, $compiler)
29     {
30         // check and get attributes
31         $_attr = $this->getAttributes($compiler, $args);
32
33         // compile always as nocache
34         $compiler->tag_nocache = true;
35
36         // display debug template
37         $_output =
38             "<?php \$_smarty_debug = new Smarty_Internal_Debug;\n \$_smarty_debug->display_debug(\$_smarty_tpl);\n";
39         $_output .= "unset(\$_smarty_debug);\n?>";
40         return $_output;
41     }
42 }