ameotoko/feathericon-bundle

Installs: 122

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

v1.0.1 2022-05-06 14:53 UTC

This package is auto-updated.

Last update: 2024-11-06 19:58:52 UTC


README

Simple Symfony/Twig wrapper for FeatherIcons and pixelrobin/php-feather library.

Installation

  1. Install using Composer:
composer require ameotoko/feathericon-bundle
  1. 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.