Skip to content

Commit

Permalink
Add substring to view support
Browse files Browse the repository at this point in the history
  • Loading branch information
MrOrangeAndHam committed Dec 8, 2022
1 parent c80e9e7 commit 98001ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/websupport/view_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@ func ModelAndView(w http.ResponseWriter, resources fs.FS, view string, data Mode
"startsWith": func(s string, prefix string) bool {
return strings.HasPrefix(s, prefix)
},
"substring": func(s string, start int, end int) string {
return s[start:end]
},
}).ParseFS(resources, views...)).Execute(w, data)
}

0 comments on commit 98001ac

Please sign in to comment.