Using Twig functions in Zenario

Twig is a template engine for PHP. In essence, it supports a subset of the server-side PHP language in which Zenario is written, and runs the code in a controlled environment.

It's easy to understand, and has a mixture of HTML and simple server-side executable code.

Zenario uses the Twig template engine for outputting HTML:

  • When modules' plugins use frameworks to format their output, the frameworks are written in Twig
  • Zenario has a specific pluggable module called a "Twig Snippet", which allows site administrators to write Twig code to be used in a specific slot on a layout or content item.

A good place for learning Twig is

All regular Twig language constructs can be used, plus the Zenario-specific functions described below.