Templates in any language rendered as safe HTML for Phoenix, such as a stored email
template previewed in a LiveView. Only defined when phoenix_live_view is installed.
Values are escaped as the template's language escapes them, and the result is written as HTML, escaped once:
{Braces.HTML.render!(@template, @data)}
<Braces.HTML.render template={@email.body} language={:liquid} data={@recipient} />
Summary
Functions
A function component that renders a template in any language in HEEx.
Renders a compiled template in any language as Braces.render!/3 does, as safe HTML:
{:safe, iodata}.
Functions
A function component that renders a template in any language in HEEx.
Attributes
template(:any) (required) - A compiled template in any language, from its module'scompile/2or its sigil, or source, compiled on each render, in thelanguagegiven.language(:atom) - The language oftemplatewhen it's source, such as:liquid, or:mustache. Defaults tonil.data(:any) - The data, asBraces.render/3takes it. Defaults to%{}.opts(:list) - Options for the language'srender/3, such astemplates:orhelpers:. Defaults to[].
Slots
error- Rendered with the error when the template doesn't compile or can't be rendered. Without it, the error is raised.
Renders a compiled template in any language as Braces.render!/3 does, as safe HTML:
{:safe, iodata}.