Lit.FlashView (Lit v0.1.2) View Source
Contains functions for dealing with flash messages.
Link to this section Summary
Functions
Returns true whenever the list of templates changes in the filesystem.
The resource name, as an atom, for this view
Returns the template root alongside all templates.
Returns a formatted flash message of the given type.
Renders the given template locally.
Callback invoked when no template is found. By default it raises but can be customized to render a particular template.
Link to this section Functions
Returns true whenever the list of templates changes in the filesystem.
The resource name, as an atom, for this view
Returns the template root alongside all templates.
Specs
flash_message(Plug.Conn.t(), type :: atom() | String.t()) :: Phoenix.HTML.safe()
Returns a formatted flash message of the given type.
Parameters
conn
: The currentPlug.Conn
.type
: The flash type, such as:error
.
Example
iex> conn = %Plug.Conn{private: %{phoenix_flash: %{"error" => "Error Message"}}}
...> flash_message(conn, "error") |> safe_to_string()
"<p class=\"lit-flash error\">Error Message <button class='lit-flash-close'>x</button></p>"
Renders the given template locally.
Specs
template_not_found(Phoenix.Template.name(), map()) :: no_return()
Callback invoked when no template is found. By default it raises but can be customized to render a particular template.