Pow v0.1.0-alpha.4 Pow.Phoenix.Template View Source

Module that can builds templates for Phoenix views using EEx with Phoenix.HTML.Engine.

Example

defmodule MyApp.ResourceTemplate do
  use Pow.Phoenix.Template

  template :new, :html, "<%= content_tag(:span, "Template") %>"

  template :edit, :html, {:form, [{:text, :custom}]}
end

MyApp.ResourceTemplate.render("new.html", assigns)

Link to this section Summary

Functions

Generates template methods

Link to this section Functions

Link to this macro template(action, atom, content) View Source (macro)
template(atom(), atom(), binary() | {atom(), any()}) :: Macro.t()

Generates template methods.

This macro that will compile a phoenix view template from the provided binary, and add the compiled version to a render/2 method. The html/1 method outputs the binary.