Braces.Mustachio.Phoenix.Engine (Braces v0.1.0)

Copy Markdown View Source

A Phoenix.Template engine for Mustachio files. Only defined when phoenix_template is installed.

# config/config.exs
config :phoenix_template, :template_engines, mustachio: Braces.Mustachio.Phoenix.Engine

emails/welcome.html.mustachio becomes a welcome/1 function whose assigns are the template's data: {{ name }} reads @name. It's compiled with your module, so a template that can't be rendered fails the build at its line. It renders as Braces.Mustachio.render/3 does. Values are HTML-escaped in HTML formats, and written as they are in others.