PieCrust

Template engines

PieCrust ships with two template engines: Twig and Mustache. Other template engines are available as plugins, like Dwoo and Haml. See how to install a plugin.

Twig

Twig is the default template engine in PieCrust, but you can use twig for your template files extensions or page configuration settings if that’s not the case. There’s a little crash course for you on the templates documentation page, along with a presentation of the extensions relevant to your PieCrust website.

Twig will look at the following site configuration settings during initialization:

  • twig/auto_escape: by default, Twig will auto-escape any content, so you want to render HTML directly, you have to use the raw filter. If twig/auto_escape is set to false, then Twig will stop auto-escaping, and you will have to do it explicitely.

Mustache

Mustache can be used with the mustache template file extension or page configuration setting. It’s a very simple template engine with an easy to remember syntax that doesn’t have any of the “programming” constructs of the other engines on purpose.

Fork me on GitHub