Trot.Template
Server side rendering of HTML using EEx templates. When the application is
compiled all of templates under a given path are loaded and compiled for
faster rendering. A render/2
function is generated for every template under
the module attribute @template_root
.
By default, @template_root
is “templates/“.
Example:
defmodule PiedPiper do
use Trot.Router
use Trot.Template
@template_root "templates/root"
get "/compression" do
render("compression_results.html.eex", [weissman_score: 5.2])
end
end
Summary↑
compile(files, root) | Finds and compiles template files |
compile(arg1, root, bool3) | |
find_all(root) | Finds all template files under a given root directory |
hash(root) | Returns the hash of all template paths in the given root |
Functions
Finds and compiles template files.
Finds all template files under a given root directory.
Specs:
- hash(String.t) :: binary
Returns the hash of all template paths in the given root.