How does Eta resolve template files?
What happens when you call renderFile(path, ...)
or <%~ includeFile(path, ...) %>
?
- If
path
is an absolute path:- First, look in
config.views
: ifconfig.views
is a path to a directory, look in it. If it is an array of directory paths, look in each - If Eta fails to find the template, look in
config.root
(by default/
, the file-system base)
- First, look in
- If
path
is a relative path:- If
includeFile()
was called from another template file, try to resolve the new template based on that template's file path - If that fails, fall back to searching
config.views
- If