Material Icons in PHP as SVG objects
Installation
composer require aciety/material-icons
Usage
<?php
use Aciety\Component\MaterialIcons\AbcIcon;
require __DIR__.'/vendor/autoload.php';
header('Content-Type: image/svg+xml');
$abcIcon = new AbcIcon();
echo $abcIcon->toXMLString(standalone: false);
Removing unneeded icons
Add this config to your composer.json: (it accepts globs, strings or regexes)
"scripts": {
"pre-autoload-dump": [
"Aciety\\Component\\MaterialIcons\\Tool\\Composer::cleanup"
]
},
"extra": {
"aciety/material-icons": {
"exclude": [
"AbcIcon.php",
"*TwoToneIcon*",
"/SharpIcon\.php$/"
]
}
}