Pow.Phoenix.Template (Pow v1.0.24) 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") %>"
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)

Specs

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.