@@ 130-150 (lines=21) @@ | ||
127 | * |
|
128 | * @return string|array|null |
|
129 | */ |
|
130 | public function scripts($return = false, $nesting = 1) |
|
131 | { |
|
132 | if (empty($this->pageScripts)) { |
|
133 | return null; |
|
134 | } |
|
135 | ||
136 | $html = []; |
|
137 | ||
138 | foreach ($this->pageScripts as $key => $value) { |
|
139 | $html[] = sprintf('<script src="%1$s"></script>', $value); |
|
140 | } |
|
141 | ||
142 | $html = implode("\n".str_repeat("\t", $nesting), $html).PHP_EOL; |
|
143 | ||
144 | if (false === $return) { |
|
145 | echo $html; |
|
146 | return null; |
|
147 | } |
|
148 | ||
149 | return $html; |
|
150 | } |
|
151 | ||
152 | /** |
|
153 | * Get stylesheet array. |
@@ 195-215 (lines=21) @@ | ||
192 | * |
|
193 | * @return string |
|
194 | */ |
|
195 | public function stylesheets($return = false, $nesting = 1) |
|
196 | { |
|
197 | if (empty($this->pageStylesheets)) { |
|
198 | return false; |
|
199 | } |
|
200 | ||
201 | $html = []; |
|
202 | ||
203 | foreach ($this->pageStylesheets as $key => $value) { |
|
204 | $html[] = sprintf('<link rel="stylesheet" href="%1$s">', $value); |
|
205 | } |
|
206 | ||
207 | $html = implode("\n".str_repeat("\t", $nesting), $html).PHP_EOL; |
|
208 | ||
209 | if (false === $return) { |
|
210 | echo $html; |
|
211 | return null; |
|
212 | } |
|
213 | ||
214 | return $html; |
|
215 | } |
|
216 | ||
217 | /** |
|
218 | * Get stylesheet array. |