|
|
@@ -405,12 +405,6 @@ class HtmlHelper extends Helper {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if ($options['once'] && isset($this->_includedAssets[$path])) {
|
|
|
- return '';
|
|
|
- }
|
|
|
- unset($options['once']);
|
|
|
- $this->_includedAssets[$path] = true;
|
|
|
-
|
|
|
if (strpos($path, '//') !== false) {
|
|
|
$url = $path;
|
|
|
} else {
|
|
|
@@ -418,6 +412,12 @@ class HtmlHelper extends Helper {
|
|
|
$options = array_diff_key($options, array('fullBase' => null, 'pathPrefix' => null));
|
|
|
}
|
|
|
|
|
|
+ if ($options['once'] && isset($this->_includedAssets[$url])) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ unset($options['once']);
|
|
|
+ $this->_includedAssets[$url] = true;
|
|
|
+
|
|
|
if ($options['rel'] === 'import') {
|
|
|
$out = $this->formatTemplate('style', [
|
|
|
'attrs' => $this->templater()->formatAttributes($options, ['rel', 'block']),
|
|
|
@@ -489,15 +489,17 @@ class HtmlHelper extends Helper {
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
- if ($options['once'] && isset($this->_includedAssets[$url])) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- $this->_includedAssets[$url] = true;
|
|
|
|
|
|
if (strpos($url, '//') === false) {
|
|
|
$url = $this->assetUrl($url, $options + array('pathPrefix' => Configure::read('App.jsBaseUrl'), 'ext' => '.js'));
|
|
|
$options = array_diff_key($options, array('fullBase' => null, 'pathPrefix' => null));
|
|
|
}
|
|
|
+
|
|
|
+ if ($options['once'] && isset($this->_includedAssets[$url])) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ $this->_includedAssets[$url] = true;
|
|
|
+
|
|
|
$out = $this->formatTemplate('javascriptlink', [
|
|
|
'url' => $url,
|
|
|
'attrs' => $this->templater()->formatAttributes($options, ['block', 'once']),
|