meanbee/magento2-svghelper

This package is abandoned and no longer maintained. No replacement package was suggested.

Magento 2 module that provides a block level helper for reading in an SVG files source from a theme

Installs: 3 566

Dependents: 0

Suggesters: 0

Security: 0

Stars: 13

Watchers: 6

Forks: 5

Open Issues: 0

Type:magento2-module

1.1.0 2017-11-17 10:10 UTC

This package is not auto-updated.

Last update: 2023-08-05 20:21:35 UTC


README

Simple module that provides a block level helper for reading in an SVG files source from a theme in Magento 2.

Installation

Install this extension via Composer:

composer require meanbee/magento2-svghelper

Development

Setting up a development environment

A Docker development environment is included with the project:

docker-compose run --rm cli magento-extension-installer Meanbee_SVGHelper \
&& docker-compose up -d

Usage

The SVGHelper is set as data on every block. This means that in your template you can call:

<?php echo $block->getData('svgHelper')->getViewSvg('pathtofile.svg') ?>

or

<?php echo $block->getData('svgHelper')->getViewSvg('Magento_Module::pathtofile.svg') ?>

This will output the raw contents of the svg file.