Skip to content

Commit 76ba09a

Browse files
committed
Allow for icon() to be passed HTML properties for SVG
1 parent 42d0b5a commit 76ba09a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Util/Block/ImageRenderer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function getByFile(string $imageFile, array $attributes = []): string
7979
throw new RuntimeException('Unable to convert file into image URL: '.$imageFile);
8080
}
8181

82-
public function icon(AbstractBlock $block, string $iconId)
82+
public function icon(AbstractBlock $block, string $iconId, array $attributes = [])
8383
{
8484
$this->block = $block;
8585
$iconSize = $this->getIconSize($iconId);
@@ -89,6 +89,7 @@ public function icon(AbstractBlock $block, string $iconId)
8989
. '.svg';
9090

9191
$attributes = [
92+
...$attributes,
9293
'width' => $iconSize,
9394
'height' => $iconSize,
9495
];

0 commit comments

Comments
 (0)