SvgInline

SvgInline

Inline SVG file manipulation

Provides simple functions for your Yii Framework 3 applications to add SVG files inline and manipulate their properties. It can be extended with Bootstrap Icons and Font Awesome Icons.

Options

file string
Valid path to a custom file.
class string
Additional custom classes.
css array
Additional CSS attributes.
fill string
Color of the icon.
height int
The height of the icon. If height is given without width, the latter will be calculated from the SVG size.
id string
Id for the SVG tag.
title string
Sets a title to the SVG output.
width int
The width of the icon. If width is given without height, the latter will be calculated from the SVG size.

Example

echo $svg->file('@vendor/path/icon.svg')->height(42)->title('Yii Rocks');

Support

Create an issue →
Packagist Version PHP Version Downloads Last Commit GitHub Workflow Status