whatwedo / twig-bootstrap-icons
Installs: 12 985
Dependents: 5
Suggesters: 0
Security: 0
Stars: 1
Watchers: 12
Forks: 1
Open Issues: 0
Requires
- twbs/bootstrap-icons: ^1.0
- twig/twig: ^2.15.3|^3.4.3
Requires (Dev)
- php: >=8.2
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.5
- symfony/config: ^7.0
- symfony/dependency-injection: ^7.0
- symfony/http-kernel: ^7.0
- whatwedo/php-coding-standard: ^1.0
README
Twig Integration for Bootstrap Icons. This bundle is inspred by marcw/twig-heroicons.
Installation
composer require whatwedo/twig-bootstrap-icons
Twig Integration
Just register the extension
$twig->addExtension(new BootstrapIconsExtensions());
Symfony Integration
// bundles.php return [ whatwedo\TwigBootstrapIcons\whatwedoTwigBootstrapIconsBundle::class => ['all' => true], ];
Usage
Outputs the SVG
{{ bootstrap_icon('alarm') }}
you can pass an array as second argument to add attributes to the <svg>
-tag:
{{ bootstrap_icon('alarm', { class: 'text-gray-500 mr-3 h-6 w-6' alt: 'alarm clock' }) }}