Where should one “plug” so that the function is called for every action of every controller BUT the controller/action is already known? Is there such a place? After the router but before the actual action.
Neither plugging into the router nor endpoint seems to be able to cut it…
It is even possible to do it in a single line in my_app_web.ex.
def controller do
quote do
use Phoenix.Controller, namespace: MyAppWeb
import Plug.Conn
import MyAppWeb.Gettext
alias MyAppWeb.Router.Helpers, as: Routes
plug MyApp.MyPlug
end
end