Download the PHP package xbirdfr/ux-icons-alias-bundle without Composer
On this page you can find all versions of the php package xbirdfr/ux-icons-alias-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xbirdfr/ux-icons-alias-bundle
More information about xbirdfr/ux-icons-alias-bundle
Files in xbirdfr/ux-icons-alias-bundle
Package ux-icons-alias-bundle
Short Description A Bundle that provides alias for Symfony UX Icons
License MIT
Homepage https://github.com/Xbirdfr/ux-icons-alias-bundle
Informations about the package ux-icons-alias-bundle
UX Icons Alias Bundle
⚠️ NOTE: This repository is no longer maintained, as Symfony UX now provides a more robust solution for handling icon aliases.
For more details, please refer to the alias system in the Symfony UX documentation.
This bundle provides an alias system for Symfony UX Icons.
It adds a Twig function on top of the IconRendererInterface
introduced in version 2.19 of symfony/ux-icons.
Installation
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Applications Using Symfony Flex
Open a terminal, navigate to your project directory, and run the following command:
Applications Not Using Symfony Flex
Step 1: Download the Bundle
Open a terminal, navigate to your project directory, and run the following command to download the latest stable version of this bundle:
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles in your project's config/bundles.php
file:
Usage
Step 1: Create the Configuration File
Create the ux_icons_alias.yaml
file in the config/packages
directory:
Step 2: Create an Alias
Create your first alias by adding a "key: icon-name" pair to the alias
array:
Don't forget to clear the cache, unless your alias will not show up
Step 3: Use Your New Alias
In a Twig template, use the ux_icon_alias
function to display your aliased icon:
One More Thing
This bundle is built on top of the symfony/ux-icons bundle.
When called, the bundle checks if the alias exists in the configuration. If it does, the corresponding value is passed to ux-icons
. If the alias does not exist, the alias name itself is passed to ux-icons
.