1 | <?php |
||
8 | class Render |
||
9 | { |
||
10 | /** |
||
11 | * @var $element AbstractElement |
||
12 | */ |
||
13 | protected $element; |
||
14 | |||
15 | /** |
||
16 | * Render constructor. |
||
17 | * @param AbstractElement $element |
||
18 | */ |
||
19 | public function __construct(AbstractElement $element) |
||
23 | |||
24 | /** |
||
25 | * Преобразовать в строку для вывода в HTML |
||
26 | * |
||
27 | * @return string |
||
28 | */ |
||
29 | public function __toString(): string |
||
49 | |||
50 | protected function render(): string |
||
84 | |||
85 | /** |
||
86 | * Получить строку классов для добавления в атрибут class |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | protected function generateClasses(): string |
||
96 | |||
97 | /** |
||
98 | * Получить строку стилей для добавления в атрибут style |
||
99 | * |
||
100 | * @return string |
||
101 | */ |
||
102 | protected function generateStyles(): string |
||
115 | |||
116 | /** |
||
117 | * Получить строку атрибутов |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | protected function generateAttributes(): string |
||
125 | |||
126 | /** |
||
127 | * Получить строку атрибутов с добавлением классов и стилей |
||
128 | * |
||
129 | * @return string |
||
130 | */ |
||
131 | protected function generateParts(): string |
||
137 | |||
138 | /** |
||
139 | * @param $collection |
||
140 | * @return string |
||
141 | */ |
||
142 | private function makeString($collection): string |
||
156 | } |