Controller for rendering the initial PhoenixDatastar page.
Generates session ID, starts GenServer, and renders the initial HTML.
By default, PhoenixDatastar.DefaultHTML is used as the mount template.
To customize the wrapper, you can override it:
Globally via application config:
config :phoenix_datastar, :html_module, MyAppWeb.DatastarHTML
Per-route via the
datastar/3macro:datastar "/counter", CounterStar, html_module: MyAppWeb.DatastarHTML
See PhoenixDatastar.DefaultHTML for a custom module example.
Summary
Functions
Mounts a Datastar view.
Functions
@spec mount(Plug.Conn.t(), map()) :: Plug.Conn.t()
Mounts a Datastar view.
Expects conn.private.datastar to contain:
:view- The view module:path- The base path:html_module- Optional HTML module override (defaults toPhoenixDatastar.DefaultHTML)