https://github.com/meanbee/magento2-svghelper
Simple module that provides a block level helper for reading in an SVG files source from a theme in Magento 2.
https://github.com/meanbee/magento2-svghelper
magento-extension magento2 magento2-extension
Last synced: 5 months ago
JSON representation
Simple module that provides a block level helper for reading in an SVG files source from a theme in Magento 2.
- Host: GitHub
- URL: https://github.com/meanbee/magento2-svghelper
- Owner: meanbee
- License: mit
- Created: 2017-02-10T12:32:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-02-10T09:27:30.000Z (over 6 years ago)
- Last Synced: 2023-07-15T10:45:47.482Z (almost 3 years ago)
- Topics: magento-extension, magento2, magento2-extension
- Language: PHP
- Size: 10.7 KB
- Stars: 13
- Watchers: 6
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Magento 2 SVG Helper
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:
```getData('svgHelper')->getViewSvg('pathtofile.svg') ?>```
or
```getData('svgHelper')->getViewSvg('Magento_Module::pathtofile.svg') ?>```
This will output the raw contents of the svg file.