shaggyrec / php-svg-icons
Svg icons api for php
Installs: 1 136
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires (Dev)
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2024-04-23 22:33:47 UTC
README
The library for providing svg icons to the php
Install
composer require shaggyrec/php-svg-icons
Usage
Get one icon:
echo Shaggyrec\SvgIcons\icon('twitter');
Get all icons:
echo Shaggyrec\SvgIcons\icons();
Find icons by name:
echo Shaggyrec\SvgIcons\icons('twi');
Customize icons
echo Shaggyrec\SvgIcons\icon('twitter', '#fff', 24, 24);
echo Shaggyrec\SvgIcons\icons('twi', '#fff', 24, 24);
Documentation
icon
- params
- [0] name (string, mandatory) - icon name
- [1] color (string, optional) - set color
- [2] width (int, optional) - set width
- [3] height (int, optional) - set height
- returns the svg icon as string
icons
- params
- [0] searchString (string, optional) - search string for icon name
- [1] color (string, optional) - set color
- [2] width (int, optional) - set width
- [3] height (int, optional) - set height
- returns the array of
['name' => 'icon-name', 'value' => '<svg.....']