Skip to content

Commit

Permalink
Add Embed SVG Fly Method helper
Browse files Browse the repository at this point in the history
 - #15
  • Loading branch information
aljawaid committed Sep 15, 2023
1 parent f2e80fb commit c13169a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Helper/SupportHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@
*/
class SupportHelper extends Base
{
/**
* Get SVG Icons for Inline Markup and CSS Styling (Embed SVG Fly Method)
*
* Include filename as class inside SVG file
* Set 'color' as 'currentColor' to use CSS or define a color
* Style using normal CSS
* @uses $this->helper->supportHelper->embedSVGIcon('icon-filename-without-extension')
* @var $svgFilename
* @return svg
* @author Erik Moberg https://www.erikmoberg.net/article/embed-svg-icons-in-html-with-php
* @author aljawaid
*/
public function embedSVGIcon($icon_filename)
{
return file_get_contents('plugins/' . $this->helper->app->getPluginName() . '/Assets/icons/' . $icon_filename . '.svg');
}

/**
* Detect User Browser
*
Expand Down

0 comments on commit c13169a

Please sign in to comment.