1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web do
7 A module that keeps using definitions for controllers,
10 This can be used in your application as:
12 use Pleroma.Web, :controller
13 use Pleroma.Web, :view
15 The definitions below will be executed for every view,
16 controller, etc, so keep them short and clean, focused
17 on imports, uses and aliases.
19 Do NOT define functions inside the quoted expressions
25 use Phoenix.Controller, namespace: Pleroma.Web
27 import Pleroma.Web.{Gettext, Router.Helpers}
34 root: "lib/pleroma/web/templates",
35 namespace: Pleroma.Web
37 # Import convenience functions from controllers
38 import Phoenix.Controller, only: [get_csrf_token: 0, get_flash: 2, view_module: 1]
40 import Pleroma.Web.{ErrorHelpers, Gettext, Router.Helpers}
48 import Phoenix.Controller
55 import Pleroma.Web.Gettext
60 When used, dispatch to the appropriate controller/view/etc.
62 defmacro __using__(which) when is_atom(which) do
63 apply(__MODULE__, which, [])
67 Pleroma.Web.Endpoint.url()