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 | 15 | 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 | 15 | public function content(...$data) |
|
115 | |||
116 | /** |
||
117 | * @return array|\drupol\htmltag\Attribute\AttributeInterface[] |
||
118 | */ |
||
119 | 15 | public function getContentAsArray() |
|
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | 11 | public function render() |
|
135 | |||
136 | /** |
||
137 | * {@inheritdoc} |
||
138 | */ |
||
139 | 1 | public function serialize() |
|
147 | |||
148 | /** |
||
149 | * {@inheritdoc} |
||
150 | */ |
||
151 | 1 | public function unserialize($serialized) |
|
159 | |||
160 | /** |
||
161 | * {@inheritdoc} |
||
162 | */ |
||
163 | 11 | protected function escape($value) |
|
175 | |||
176 | /** |
||
177 | * Render the tag content. |
||
178 | * |
||
179 | * @return null|string |
||
180 | */ |
||
181 | 15 | protected function renderContent() |
|
187 | } |
||
188 |