View Source Phoenix.LiveView.HTMLEngine (Phoenix LiveView v0.18.13)

The HTMLEngine that powers .heex templates and the ~H sigil.

It works by adding a HTML parsing and validation layer on top of EEx engine. By default it uses Phoenix.LiveView.Engine as its "subengine".

Link to this section Summary

Functions

Renders a component defined by the given function.

Define a inner block, generally used by slots.

Link to this section Functions

Link to this function

component(func, assigns, caller)

View Source

Renders a component defined by the given function.

This function is rarely invoked directly by users. Instead, it is used by ~H to render Phoenix.Components. For example, the following:

<MyApp.Weather.city name="Kraków" />

Is the same as:

<%= component(
      &MyApp.Weather.city/1,
      [name: "Kraków"],
      {__ENV__.module, __ENV__.function, __ENV__.file, __ENV__.line}
    ) %>
Link to this macro

inner_block(name, list)

View Source (macro)

Define a inner block, generally used by slots.

This macro is mostly used by HTML engines that provide a slot implementation and rarely called directly. The name must be the assign name the slot/block will be stored under.

If you're using HEEx templates, you should use its higher level <:slot> notation instead. See Phoenix.Component for more information.