Skip to content

Latest commit

 

History

History
executable file
·
81 lines (60 loc) · 3.17 KB

README.md

File metadata and controls

executable file
·
81 lines (60 loc) · 3.17 KB

Icon Plugin for Flextype

Version License Total downloads Flextype Discord

Icon plugin to present most popular icons sets in SVG format for Flextype.

This plugin currently contains 3 primary SVG icon sets:

Dependencies

The following dependencies need to be installed for Icon Plugin.

System

Item Version Download
flextype 0.9.16 download
twig >=2.0.0 download

Installation

  1. Download & Install all required dependencies.
  2. Create new folder /project/plugins/icon
  3. Download Icon Plugin and unzip plugin content to the folder /project/plugins/icon

Settings

Key Value Description
enabled true true or false to disable the plugin
priority 1 Icon plugin priority

Documentation

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

Usage

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');

LICENSE

The MIT License (MIT) Copyright (c) 2021 Sergey Romanenko