summaryrefslogtreecommitdiff
path: root/src/ParseTree/Text.php
blob: e6131407c268a3e4a15aebbe11b80d145517e5ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php

namespace Smarty\ParseTree;

/**
 * Smarty Internal Plugin Templateparser Parse Tree
 * These are classes to build parse tree in the template parser
 *


 * @author     Thue Kristensen
 * @author     Uwe Tews
 *             *
 *             template text


 * @ignore
 */
class Text extends Base
{

    /**
     * Wether this section should be stripped on output to smarty php
     * @var bool
     */
    private $toBeStripped = false;

    /**
     * Create template text buffer
     *
     * @param string $data text
     * @param bool $toBeStripped wether this section should be stripped on output to smarty php
     */
    public function __construct($data, $toBeStripped = false)
    {
        $this->data = $data;
        $this->toBeStripped = $toBeStripped;
    }

    /**
     * Wether this section should be stripped on output to smarty php
     * @return bool
     */
    public function isToBeStripped() {
        return $this->toBeStripped;
    }

    /**
     * Return buffer content
     *
     * @param \Smarty\Parser\TemplateParser $parser
     *
     * @return string text
     */
    public function to_smarty_php(\Smarty\Parser\TemplateParser $parser)
    {
        return $this->data;
    }
}