A LiveView with Render
This LiveView uses only render/1
.
Documentation:
https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#c:render/1
scope "/", LiveViewBasicsWeb do
pipe_through :browser
live "/render", RenderLive
end
defmodule LiveViewBasicsWeb.RenderLive do
use LiveViewBasicsWeb, :live_view
def render(assigns) do
~H"""
<Layouts.app flash={@flash}>
<div class="hero">
<div class="hero-content">
<div>
<h1 class="text-4xl font-bold text-center">A LiveView with Render</h1>
<p class="py-6 text-left">
This LiveView uses only <code class="bg-base-content text-base-100 px-1">render/1</code>.
</p>
</div>
</div>
</div>
</Layouts.app>
"""
end
end