ameotoko / feathericon-bundle
Installs: 122
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.4 || ^8.0
- pixelrobin/php-feather: ^1.0
README
Simple Symfony/Twig wrapper for FeatherIcons and pixelrobin/php-feather library.
Installation
- Install using Composer:
composer require ameotoko/feathericon-bundle
- Enable the bundle:
// config/bundles.php return [ // ... Ameotoko\FeatherIcon\AmeotokoFeatherIconBundle::class => ['all' => true], ];
Usage
The bundle provides new function in your Twig templates, which simply uses getIcon()
from php-feather under the hood.
This code in your .html.twig
template:
<button type="submit">{{ feathericon('send', {stroke: '#ddd', 'stroke-width': 4}) }} Submit</button>
will produce the same result as:
<?php $icons = new \Feather\Icons(); ?> <button type="submit"><?= $icons->get('send', ['stroke' => '#ddd', 'stroke-width' => 4], false) ?> Submit</button>
See more about using php-feather
.