Documentation ¶
Overview ¶
Package tpl provides facilities for loading and displaying templates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = fmt.Errorf("template not found")
Returned by TryShow if a template is not found.
View Source
var GetContextFunc func(req *http.Request) interface{}
If this is non-nil, the value returned by this function will always be set as "c" in the args passed to Show.
View Source
var _, Log = xlog.New("web.tpl")
Functions ¶
func GetTemplate ¶
Try to find a template with the given name. Returns nil if there is no such template loaded.
func LoadTemplates ¶
Load all templates from the given directory. The templates must have the file extension ".p2".
Types ¶
Click to show internal directories.
Click to hide internal directories.