3 * Smarty Internal Plugin Templateparser Parsetrees
4 * These are classes to build parsetrees in the template parser
8 * @author Thue Kristensen
13 * A complete smarty tag.
16 * @subpackage Compiler
19 class Smarty_Internal_ParseTree_Tag
extends Smarty_Internal_ParseTree
22 * Saved block nesting level
26 public $saved_block_nesting;
29 * Create parse tree buffer for Smarty tag
31 * @param object $parser parser object
32 * @param string $data content
34 public function __construct($parser, $data)
36 $this->parser
= $parser;
38 $this->saved_block_nesting
= $parser->block_nesting_level
;
42 * Return buffer content
44 * @return string content
46 public function to_smarty_php()
52 * Return complied code that loads the evaluated output of buffer content into a temporary variable
54 * @return string template code
56 public function assign_to_var()
58 $var = sprintf('$_tmp%d', ++ Smarty_Internal_Templateparser
::$prefix_number);
59 $this->parser
->compiler
->prefix_code
[] = sprintf("<?php ob_start();?>%s<?php %s=ob_get_clean();?>", $this->data
, $var);