Functions for using htmx with Phoenix applications.
Summary
Functions
Renders several templates, concatenating the results.
Types
Functions
@spec render_many(Plug.Conn.t(), [template() | {template(), assigns()}]) :: Plug.Conn.t()
Renders several templates, concatenating the results.
Elements of the templates list can be atoms, strings, or tuples of an
atom/string and a keyword list of assigns, which will be passed to the
template.
This function does not render layouts, because it assumes you're using it to render htmx out-of-band swaps, which don't need layouts. This function also assumes that it is rendering HTML.
Examples
conn
|> Hypa.Phoenix.render_many([
:foo,
{:bar, [a: 1]},
{"baz", [b: 2, c: 3]}
])