Phoenix.Template.Compiler

Precompiles EEx templates into view module and provides render support

Uses Mix config :template_engines dict to map template extensions to Template Engine compilers.

Template Engines

See the Phoenix.Template.Engine behaviour for custom engines

Examples

defmodule MyApp.MyView do
  use Phoenix.Template.Compiler, path: Path.join([__DIR__, "templates"])
end

iex> MyApp.MyView.render("show.html", message: "Hello!")
"<h1>Hello!</h1>"