You are here

public function TypeStyleExtension::getFunctions in Type Style 8

Generates a list of all Twig functions that this extension defines.

Return value

array A key/value array that defines custom Twig functions. The key denotes the function name used in the tag, e.g.:


  {{ testfunc() }}
  

The value is a standard PHP callback that defines what the function does.

File

src/TwigExtension/TypeStyleExtension.php, line 25

Class

TypeStyleExtension
A Twig extension to render type styles.

Namespace

Drupal\type_style\TwigExtension

Code

public function getFunctions() {
  return [
    'type_style' => new TwigFunction('type_style', [
      'Drupal\\type_style\\TwigExtension\\TypeStyleExtension',
      'getTypeStyle',
    ]),
  ];
}