Twig extensions

Last updated: Wed, 08 Sep 2021 23:18

3 extensions are provided with Twig Package :

  • Berlioz\Package\Twig\Extension\AssetExtension
  • Berlioz\Package\Twig\Extension\DefaultExtension
  • Berlioz\Package\Twig\Extension\RouterExtension

Extension AssetExtension

Functions provided:

  • asset()
  • entrypoints()
  • entrypoints_list()
  • preload()

Extension DefaultExtension

Filters provided:

  • date_format
  • truncate
  • nl2p
  • human_file_size
  • json_decode
  • basename

Tests provided:

  • instance of

Extension RouterExtension

Functions provided:

  • path()
  • path_exists()