Macro for template engine Latte which can render Font Awesome icon.

Installation

  • If you use Nette, add to config.neon this:
latte:
	macros:
		- Fazette\Latte\Fa
  • If you use only Latte, install it like this:
<?php
$latte = new Latte\Engine;
$latte->onCompile[] = function(\Latte\Engine $engine) {
	\Fazette\Latte\Fa::install($engine->getCompiler());
};

Usage

For example rendering icon fa-car, use:

  • {fa car} for Font Awesome 4
  • {fa s, car} for Font Awesome 5

Macro renders this: Car

You can use some more arguments, just look for examples in tests.