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.

live_patch(opts) deprecated
live_redirect(opts) deprecated

Renders a title tag with automatic prefix/suffix on @page_title updates.

Renders the @inner_block assign of a component with the given argument.

sigil_L(arg, list) deprecated

Provides ~L sigil with HTML safe Live EEx syntax inside source files.

Link to this section Functions

Link to this macro

live_component(component, assigns, do_block \\ [])

View Source (macro)
This macro is deprecated. Use .live_component (live_component/1) instead.

Deprecated API for rendering LiveComponent.

upgrading

Upgrading

In order to migrate from <%= live_component ... %> to <.live_component>, you must first:

  1. Migrate from ~L sigil and .leex templates to ~H sigil and .heex templates

  2. Then instead of:

    <%= live_component MyModule, id: "hello" do %>
    ...
    <% end %>

    You should do:

    <.live_component module={MyModule} id="hello">
    ...
    </.live_component>
  3. If your component is using render_block/2, replace it by render_slot/2

Link to this function

live_file_input(conf, opts)

View Source
This function is deprecated. Use <.live_file_input /> instead.
Link to this function

live_img_preview(entry, opts)

View Source
This function is deprecated. Use <.live_img_preview /> instead.
This function is deprecated. Use link/1 instead.
This function is deprecated. Use <.link> instead.
This function is deprecated. Use <.link> instead.
Link to this function

live_redirect(text, opts)

View Source
This function is deprecated. Use <.link> instead.
Link to this function

live_title_tag(title, opts \\ [])

View Source
This function is deprecated. Use <.live_title> instead.

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" %>
Link to this macro

render_block(inner_block, argument \\ [])

View Source (macro)
This macro is deprecated. Use render_slot/2 instead.

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.

Link to this macro

sigil_L(arg, list)

View Source (macro)
This macro is deprecated. Use ~H instead.

Provides ~L sigil with HTML safe Live EEx syntax inside source files.

iex> ~L"""
...> Hello <%= "world" %>
...> """
{:safe, ["Hello ", "world", "\n"]}