Icon Plugin for Flextype
Icon plugin to present most popular icons sets in SVG format for Flextype.
This plugin currently contains 3 primary SVG icon sets:
- Font Awesome - A set of 1600+ free high-quality SVG icons by Fonticons, Inc.
- Bootstrap Icons - A set of 1200+ free high-quality SVG icons by Bootstrap Team
- Tabler Icons - A set of 950+ free high-quality SVG icons by Csaba Kissi
The following dependencies need to be installed for Icon Plugin.
Item | Version | Download |
---|---|---|
flextype | 0.9.16 | download |
twig | >=2.0.0 | download |
- Download & Install all required dependencies.
- Create new folder
/project/plugins/icon
- Download Icon Plugin and unzip plugin content to the folder
/project/plugins/icon
Key | Value | Description |
---|---|---|
enabled | true | true or false to disable the plugin |
priority | 1 | Icon plugin priority |
Global function icon()
/**
* Get SVG icon from specific icons set.
*
* @param string|null $name Icon name.
* @param string|null $set Icon set:
* - tabler
* - bootstrap
* - fontawesome|brands,
* - fontawesome|regular
* - fontawesome|solid
* @param string|null $class CSS Class.
*
* @return string
*/
function icon(?string $name = null, ?string $set = 'fontawesome|solid', ?string $class = null): string
Display icon in the twig templates
{{ icon('apple', 'fontawesome|brands') }}
Display icon in the entry content
[icon name="apple" set="fontawesome|brands"]
Display icon in the php
echo icon('apple', 'fontawesome|brands');
The MIT License (MIT) Copyright (c) 2021 Sergey Romanenko