Skip to content

Support for inline LiveView templates #184

@egze

Description

@egze

What is the right place to add support for inline templates?

Here is an example:

defmodule AppWeb.ThermostatLive do
  use Phoenix.LiveView

  def render(assigns) do
    ~L"""
    <div class="widget">
      Current temperature: <string><%= @temperature %></strong>
    </div>
    """
  end

  def mount(_params, %{"current_user_id" => user_id}, socket) do
    temperature = Thermostat.get_user_reading(user_id)
    {:ok, assign(socket, :temperature, temperature)}
  end
end

Ideally I would like the part inside the sigil to be highlighted as eex html template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions