You've already forked tribes-plugin-template
30
lib/my_plugin_web/live/home_live.ex
Normal file
30
lib/my_plugin_web/live/home_live.ex
Normal file
@@ -0,0 +1,30 @@
|
||||
defmodule MyPluginWeb.HomeLive do
|
||||
@moduledoc """
|
||||
Example LiveView page for the plugin.
|
||||
|
||||
This page is registered in the plugin spec and mounted by the host
|
||||
at /plugins/my_plugin.
|
||||
"""
|
||||
|
||||
# In dev mode (plugin loaded as path dep), you can use host macros:
|
||||
# use TribesWeb, :live_view
|
||||
#
|
||||
# For release builds (standalone OTP app), use Phoenix.LiveView directly:
|
||||
use Phoenix.LiveView
|
||||
|
||||
def mount(_params, _session, socket) do
|
||||
{:ok, assign(socket, :page_title, "My Plugin")}
|
||||
end
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<div class="p-6">
|
||||
<h1 class="text-2xl font-bold">My Plugin</h1>
|
||||
<p class="mt-2 text-base-content/70">
|
||||
This is a Tribes plugin. Edit this page in
|
||||
<code>lib/my_plugin_web/live/home_live.ex</code>.
|
||||
</p>
|
||||
</div>
|
||||
"""
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user