Icon

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

Sergey Romanenko


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

This plugin currently contains 3 primary SVG icon sets:

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

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

Version

2.1.0

Lincense

MIT

Dependencies

flextype: 0.9.16
twig: >=2.0.0

Categories

templating, icons