mirror of
https://github.com/ent/ent.git
synced 2026-04-28 05:30:56 +03:00
doc/template: add docs for template helpers
This commit is contained in:
committed by
Ariel Mashraki
parent
81eeefa6a2
commit
6ff6e81652
@@ -617,7 +617,7 @@ func (g *Graph) templates() (*Template, []GraphTemplate) {
|
||||
name := tmpl.Name()
|
||||
switch {
|
||||
// Helper templates can be either global (prefixed with "helper/"),
|
||||
// or local, where their names follow the format: <root-tmpl>/helper/.+).
|
||||
// or local, where their names follow the format: "<root-tmpl>/helper/.+").
|
||||
case strings.HasPrefix(name, "helper/"):
|
||||
case strings.Contains(name, "/helper/"):
|
||||
helpers[name] = struct{}{}
|
||||
|
||||
Reference in New Issue
Block a user