Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hyvor/php-svg-icons
PHP SVG Icons
https://github.com/hyvor/php-svg-icons
Last synced: 27 days ago
JSON representation
PHP SVG Icons
- Host: GitHub
- URL: https://github.com/hyvor/php-svg-icons
- Owner: hyvor
- License: mit
- Created: 2022-04-29T17:20:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-09T09:32:35.000Z (3 months ago)
- Last Synced: 2024-11-16T13:50:04.942Z (about 1 month ago)
- Language: PHP
- Homepage: https://hyvor.com
- Size: 3.88 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## How to use
Installation:
```bash
composer require hyvor/php-svg-icons
```Format:
```php
$icon = new Icon($library, $iconName);
$svg = $icon->getSvg($width, $height);
```Example:
```php
$icon = new Icon('bootstrap', '123');$icon->getSvg(); // 16x16
$icon->getSvg(20); // 20x20
$icon->getSvg(20, 25); // 20x25
```## Contributing
### How to add a new icon library
* Create `icons/{library_name}` folder with a `.gitkeep` file in it
* Add configuration to `src/libs.php`
* Create a fetcher in `src/Fetcher/{LibraryName}.php`. See other fetchers to see how it works. Usually, you have to download the SVG icons from somewhere and add them to the icons folders.Use `php run.php` to run all fetchers and update icons.