defmodule PlatoWeb do
def html do
quote do
use Phoenix.Component
import Phoenix.Controller,
only: [get_csrf_token: 0, view_module: 1, view_template: 1]
unquote(html_helpers())
end
end
defp html_helpers do
quote do
import Phoenix.HTML
alias Phoenix.LiveView.JS
unquote(verified_routes())
end
end
def verified_routes do
quote do
use Phoenix.VerifiedRoutes,
endpoint: PlatoWeb.Endpoint,
router: PlatoWeb.Router,
statics: ~w(css fonts images favicon.ico robots.txt)
end
end
defmacro __using__(which) when is_atom(which) do
apply(__MODULE__, which, [])
end
end