1 | <?php |
||
11 | class Tag extends AbstractBaseHtmlTagObject implements TagInterface |
||
12 | { |
||
13 | /** |
||
14 | * The tag name. |
||
15 | * |
||
16 | * @var string |
||
17 | */ |
||
18 | private $tag; |
||
19 | |||
20 | /** |
||
21 | * The tag attributes. |
||
22 | * |
||
23 | * @var \drupol\htmltag\Attributes\AttributesInterface |
||
24 | */ |
||
25 | private $attributes; |
||
26 | |||
27 | /** |
||
28 | * The tag content. |
||
29 | * |
||
30 | * @var mixed[]|null |
||
31 | */ |
||
32 | private $content; |
||
33 | |||
34 | /** |
||
35 | * Tag constructor. |
||
36 | * |
||
37 | * @param \drupol\htmltag\Attributes\AttributesInterface $attributes |
||
38 | * The attributes object. |
||
39 | * @param string $name |
||
40 | * The tag name. |
||
41 | * @param mixed $content |
||
42 | * The content. |
||
43 | */ |
||
44 | 10 | public function __construct(AttributesInterface $attributes, $name, $content = false) |
|
50 | |||
51 | /** |
||
52 | * @param string $name |
||
53 | * @param array $arguments |
||
54 | * |
||
55 | * @return \drupol\htmltag\Tag\TagInterface |
||
56 | */ |
||
57 | 1 | public static function __callStatic($name, array $arguments = []) |
|
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 1 | public function __toString() |
|
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | 3 | public function attr($name = null, ...$value) |
|
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | 10 | public function content(...$content) |
|
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | 8 | public function render() |
|
115 | |||
116 | /** |
||
117 | * Render the tag content. |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | 10 | private function renderContent() |
|
144 | |||
145 | /** |
||
146 | 10 | * Sanitize a string. |
|
147 | 10 | * |
|
148 | 10 | * @param string $string |
|
149 | * The string to sanitize. |
||
150 | 10 | * |
|
151 | * @return string |
||
152 | * The sanitized string. |
||
153 | */ |
||
154 | protected function sanitize($string) { |
||
161 | |||
162 | 1 | /** |
|
163 | 1 | * {@inheritdoc} |
|
164 | 1 | */ |
|
165 | 1 | public function serialize() |
|
173 | |||
174 | 1 | /** |
|
175 | * {@inheritdoc} |
||
176 | 1 | */ |
|
177 | 1 | public function unserialize($serialized) |
|
185 | |||
186 | /** |
||
187 | * Alter the values of an object. |
||
188 | * |
||
189 | * @param callable ...$closures |
||
190 | * A closure. |
||
191 | * |
||
192 | * @return object |
||
193 | 1 | * The object. |
|
194 | */ |
||
195 | 1 | /** |
|
196 | 1 | * {@inheritdoc} |
|
197 | 1 | */ |
|
198 | public function alter(callable ...$closures) |
||
208 | } |
||
209 |