@@ 133-145 (lines=13) @@ | ||
130 | * @param LambdaHelper $helper For rendering strings in the current context. |
|
131 | * @return void |
|
132 | */ |
|
133 | public function addJsRequirement($js, LambdaHelper $helper = null) |
|
134 | { |
|
135 | $js = trim($js); |
|
136 | $key = md5($js); |
|
137 | ||
138 | if (!isset(self::$jsRequirements[$key])) { |
|
139 | if ($helper !== null) { |
|
140 | $js = $helper->render($js); |
|
141 | } |
|
142 | ||
143 | self::$jsRequirements[$key] = $js; |
|
144 | } |
|
145 | } |
|
146 | ||
147 | /** |
|
148 | * Get the JavaScript requirements and purge the store. |
|
@@ 208-220 (lines=13) @@ | ||
205 | * @param LambdaHelper $helper For rendering strings in the current context. |
|
206 | * @return void |
|
207 | */ |
|
208 | public function addCssRequirement($css, LambdaHelper $helper = null) |
|
209 | { |
|
210 | $css = trim($css); |
|
211 | $key = md5($css); |
|
212 | ||
213 | if (!isset(self::$cssRequirements[$key])) { |
|
214 | if ($helper !== null) { |
|
215 | $css = $helper->render($css); |
|
216 | } |
|
217 | ||
218 | self::$cssRequirements[$key] = $css; |
|
219 | } |
|
220 | } |
|
221 | ||
222 | /** |
|
223 | * Get the CSS requirements and purge the store. |