View Source Phoenix.LiveView.Helpers (Phoenix LiveView v0.18.0)
This module is deprecated and all of its functions.
You must use Phoenix.Component
instead.
Link to this section Summary
Functions
Deprecated API for rendering LiveComponent
.
Renders a title tag with automatic prefix/suffix on @page_title
updates.
Renders the @inner_block
assign of a component with the given argument
.
Provides ~L
sigil with HTML safe Live EEx syntax inside source files.
Link to this section Functions
Deprecated API for rendering LiveComponent
.
upgrading
Upgrading
In order to migrate from <%= live_component ... %>
to <.live_component>
,
you must first:
Migrate from
~L
sigil and.leex
templates to~H
sigil and.heex
templatesThen instead of:
<%= live_component MyModule, id: "hello" do %> ... <% end %>
You should do:
<.live_component module={MyModule} id="hello"> ... </.live_component>
If your component is using
render_block/2
, replace it byrender_slot/2
Renders a title tag with automatic prefix/suffix on @page_title
updates.
examples
Examples
<%= live_title_tag assigns[:page_title] || "Welcome", prefix: "MyApp – " %>
<%= live_title_tag assigns[:page_title] || "Welcome", suffix: " – MyApp" %>
Renders the @inner_block
assign of a component with the given argument
.
<%= render_block(@inner_block, value: @value)
This function is deprecated for function components. Use render_slot/2
instead.
Provides ~L
sigil with HTML safe Live EEx syntax inside source files.
iex> ~L"""
...> Hello <%= "world" %>
...> """
{:safe, ["Hello ", "world", "\n"]}