Conditions | 6 |
Paths | 10 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
51 | public static function styles($context, $return = false) |
||
52 | { |
||
53 | if ($context instanceof Tpl) { |
||
54 | $styles = $context->getStyles(); |
||
55 | } else { |
||
56 | $styles = $context; |
||
57 | } |
||
58 | |||
59 | if (empty($styles) || !is_array($styles)) { |
||
60 | return; |
||
61 | } |
||
62 | |||
63 | $data = []; |
||
64 | |||
65 | foreach ($styles as $style) { |
||
66 | $data[] = sprintf('<link href="%s" rel="stylesheet">', $style); |
||
67 | } |
||
68 | |||
69 | if ($return) { |
||
70 | return $data; |
||
71 | } else { |
||
72 | echo implode("\n", $data); |
||
73 | } |
||
74 | } |
||
75 | } |
||
76 |