1 | <?php |
||
12 | abstract class AbstractTag extends AbstractBaseHtmlTagObject implements TagInterface |
||
13 | { |
||
14 | /** |
||
15 | * The tag attributes. |
||
16 | * |
||
17 | * @var \drupol\htmltag\Attributes\AttributesInterface |
||
18 | */ |
||
19 | private $attributes; |
||
20 | |||
21 | /** |
||
22 | * The tag content. |
||
23 | * |
||
24 | * @var null|mixed[] |
||
25 | */ |
||
26 | private $content; |
||
27 | /** |
||
28 | * The tag name. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | private $tag; |
||
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 | 14 | public function __construct(AttributesInterface $attributes, $name, $content = null) |
|
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 | 2 | public function __toString() |
|
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | 1 | public function alter(callable ...$closures) |
|
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | 3 | public function attr($name = null, ...$value) |
|
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | 14 | public function content(...$data) |
|
115 | |||
116 | /** |
||
117 | * {@inheritdoc} |
||
118 | */ |
||
119 | 10 | public function escape($value) |
|
131 | |||
132 | /** |
||
133 | * @return array|\drupol\htmltag\Attribute\AttributeInterface[] |
||
134 | */ |
||
135 | 14 | public function getContentAsArray() |
|
141 | |||
142 | /** |
||
143 | * {@inheritdoc} |
||
144 | */ |
||
145 | 14 | public function preprocess(array $values, array $context = []) |
|
149 | |||
150 | /** |
||
151 | * {@inheritdoc} |
||
152 | */ |
||
153 | 10 | public function render() |
|
159 | |||
160 | /** |
||
161 | * {@inheritdoc} |
||
162 | */ |
||
163 | 1 | public function serialize() |
|
171 | |||
172 | /** |
||
173 | * {@inheritdoc} |
||
174 | */ |
||
175 | 1 | public function unserialize($serialized) |
|
183 | |||
184 | /** |
||
185 | * Render the tag content. |
||
186 | * |
||
187 | * @return null|string |
||
188 | */ |
||
189 | 14 | protected function renderContent() |
|
195 | } |
||
196 |