Parsed HTMX request metadata, derived from the HX-* request headers that
the HTMX client sends.
Phtmx.Plug builds one of these for every request and assigns it as
conn.assigns.htmx, so controllers and templates can branch on it:
<div :if={@htmx.request?}>...only rendered for HTMX requests...</div>
def index(conn, _params) do
if conn.assigns.htmx.boosted?, do: ..., else: ...
end
Summary
Types
Functions
@spec from_conn(Plug.Conn.t()) :: t()
Builds a t/0 from a Plug.Conn's request headers.
A request is considered an HTMX request when it carries HX-Request: true.