diff --git a/Model/Html/Head.php b/Model/Html/Head.php
index d2fe2bb9b..f0d743416 100644
--- a/Model/Html/Head.php
+++ b/Model/Html/Head.php
@@ -147,9 +147,9 @@ class Head implements RenderableInterface
*
* @since 1.0.0
*/
- public function addAsset(int $type, string $uri) : void
+ public function addAsset(int $type, string $uri, array $attributes = []) : void
{
- $this->assets[$uri] = $type;
+ $this->assets[$uri] = ['type' => $type, 'attributes' => $attributes];
}
/**
@@ -299,16 +299,22 @@ class Head implements RenderableInterface
*/
public function renderAssets() : string
{
- $asset = '';
- foreach ($this->assets as $uri => $type) {
- if ($type === AssetType::CSS) {
- $asset .= '';
- } elseif ($type === AssetType::JS) {
- $asset .= '';
+ $rendered = '';
+ foreach ($this->assets as $uri => $asset) {
+ if ($asset['type'] === AssetType::CSS) {
+ $rendered .= '';
+ } elseif ($asset['type'] === AssetType::JS) {
+ $rendered .= '';
}
}
- return $asset;
+ return $rendered;
}
/**
@@ -320,13 +326,19 @@ class Head implements RenderableInterface
*/
public function renderAssetsLate() : string
{
- $asset = '';
- foreach ($this->assets as $uri => $type) {
- if ($type === AssetType::JSLATE) {
- $asset .= '';
+ $rendered = '';
+ foreach ($this->assets as $uri => $asset) {
+ if ($asset['type']=== AssetType::JSLATE) {
+ $rendered .= '';
}
}
- return $asset;
+ return $rendered;
}
}