2017 © Pedro Peláez
 

library inline-svg

PHP library to embed svg in the html

image

oscarotero/inline-svg

PHP library to embed svg in the html

  • Thursday, September 1, 2016
  • by oscarotero
  • Repository
  • 1 Watchers
  • 10 Stars
  • 2,109 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 16 % Grown

The README.md

InlineSvg

PHP library to embed svg icons in the html pages so you can use css to change the style. Why do not use icon fonts? Here a comparison svg vs fonts, (*1)

Requirements:

Installation

This package is installable and autoloadable via Composer as oscarotero/inline-svg., (*2)

$ composer require oscarotero/inline-svg

Usage:

use InlineSvg\Collection;
use InlineSvg\Transformers\Cleaner;

$icons = Collection::fromPath('path/to/svg/files');

//Add a cleaner transformer to remove ids
$icons->addTransformer(new Cleaner());

//Insert the svg code of the file 'edit.svg':
echo $icons->get('edit'); // <svg ... </svg>

//Modify any attribute
echo $icons->get('edit')->withAttribute('class', 'big-icon'); // <svg class="big-icon" .. </svg>

//Make the svg accesible
echo $icons->get('edit')->withA11y('The edit icon'); // <svg role="img" aria-labelledby="icon-edit-123-title"><title id="icon-edit-123-title">The edit icon</title> .. </svg>

The Versions

01/09 2016

dev-master

9999999-dev https://github.com/oscarotero/inline-svg

PHP library to embed svg in the html

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

icons svg

25/08 2016

v2.0.1

2.0.1.0 https://github.com/oscarotero/inline-svg

PHP library to embed svg in the html

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

icons svg

21/07 2016

v2.0.0

2.0.0.0 https://github.com/oscarotero/inline-svg

PHP library to embed svg in the html

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

icons svg

04/03 2016

v1.0.0

1.0.0.0 https://github.com/oscarotero/inline-svg

PHP library to embed svg in the html

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

icons svg