# `Braces.Mustache.Phoenix.Engine`
[🔗](https://github.com/dbernheisel/braces/blob/v0.1.0/lib/braces/mustache/phoenix/engine.ex#L2)

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

    # config/config.exs
    config :phoenix_template, :template_engines, mustache: Braces.Mustache.Phoenix.Engine

Then `embed_templates "emails/*"` turns `emails/welcome.html.mustache` into a `welcome/1`
function, whose assigns are the template's data: `{{first_name}}` reads `@first_name`.

The file is parsed when your module compiles, so a template that doesn't parse raises a
`CompileError` at its line. It renders as `Braces.Mustache.render/3` renders it: a missing
value renders nothing, as Mustache says. There are no partials.

In an HTML format, values are HTML-escaped and the result is safe HTML that Phoenix doesn't
escape again. In other formats, such as `welcome.text.mustache`, values are written as they
are.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
