1 | <?php |
||
30 | class Comment extends Tag { |
||
31 | protected $commentstyle; |
||
32 | |||
33 | function __construct($type) { |
||
34 | if ($type == "/") |
||
35 | $this->commentstyle = "HTML"; |
||
36 | } |
||
37 | |||
38 | function renderStTag() { |
||
39 | return $this->commentstyle == "HTML" ? "<!-- " : ""; |
||
40 | } |
||
41 | |||
42 | function renderContent($pad = "", $oneliner = false) { |
||
43 | if ($this->commentstyle == "HTML") |
||
44 | if (count($this->content) > 1) |
||
45 | return $pad . " " . implode("\n$pad", $this->content) . "\n"; |
||
46 | else |
||
47 | return current($this->content); |
||
48 | return ""; |
||
49 | } |
||
50 | |||
51 | function renderEnTag() { |
||
52 | return $this->commentstyle == "HTML" ? " -->" : ""; |
||
53 | } |
||
54 | } |