source: trunk/include/smarty/libs/sysplugins/smarty_internal_compile_debug.php @ 23384

Last change on this file since 23384 was 23384, checked in by rvelices, 11 years ago

smarty 3 - first pass for tests

File size: 1.0 KB
Line 
1<?php
2/**
3 * Smarty Internal Plugin Compile Debug
4 *
5 * Compiles the {debug} tag.
6 * It opens a window the the Smarty Debugging Console.
7 *
8 * @package Smarty
9 * @subpackage Compiler
10 * @author Uwe Tews
11 */
12
13/**
14 * Smarty Internal Plugin Compile Debug Class
15 *
16 * @package Smarty
17 * @subpackage Compiler
18 */
19class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase {
20
21    /**
22     * Compiles code for the {debug} tag
23     *
24     * @param array  $args     array with attributes from parser
25     * @param object $compiler compiler object
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 = "<?php \$_smarty_tpl->smarty->loadPlugin('Smarty_Internal_Debug'); Smarty_Internal_Debug::display_debug(\$_smarty_tpl); ?>";
38        return $_output;
39    }
40
41}
42
43?>
Note: See TracBrowser for help on using the repository browser.