template
Types from PocketBase's Go package template, as JavaScript sees them: you get these objects from $app and the other globals and from hook events, and call their methods by their JS names (Go's FindRecordById is findRecordById). The same package in Go: template.
template.Registry
Registry defines a templates registry that is safe to be used by multiple goroutines.
Use the Registry.Load* methods to load templates into the registry.
| Member | Type | |
|---|---|---|
addFuncs() |
(funcs: { [key: string]: any }): (Registry) |
AddFuncs registers new global template functions. |
loadFiles() |
(...filenames: string[]): (Renderer) |
LoadFiles caches (if not already) the specified filenames set as a single template and returns a ready to use Renderer instance. |
loadString() |
(text: string): (Renderer) |
LoadString caches (if not already) the specified inline string as a single template and returns a ready to use Renderer instance. |
loadFS() |
(fsys: fs.FS, ...globPatterns: string[]): (Renderer) |
LoadFS caches (if not already) the specified fs and globPatterns pair as single template and returns a ready to use Renderer instance. |
template.Renderer
Renderer defines a single parsed template.
| Member | Type | |
|---|---|---|
render() |
(data: any): string |
Render executes the template with the specified data as the dot object and returns the result as plain string. |
Questions and comments
Comments are a GitHub Discussions thread; sign in with GitHub to post.