Where is render defined?

phoenix
phoenix-14
#1

Which of these expressions is the ‘render’ function defined?

  import Plug.Conn
  import HelloWeb.Gettext
  alias HelloWeb.Router.Helpers, as: Routes
#2

render is a Phoenix.Controller function: https://hexdocs.pm/phoenix/Phoenix.Controller.html#render/2
but there is also a render function in Phoenix.View: https://hexdocs.pm/phoenix/Phoenix.View.html#render/3

In MyApp_web.ex, from where you copied that fragment, the line:

use Phoenix.Controller

Is where render comes from.

9 Likes