Browse Source

Fix TemplateService helpers initialization

extension
wpetit 4 years ago
parent
commit
100cf83917
  1. 3
      template/html/option.go

3
template/html/option.go

@ -33,6 +33,9 @@ func WithDefaultHelpers() OptionFunc {
// to expose the default helpers
func WithHelper(name string, fn interface{}) OptionFunc {
return func(opts *Options) {
if opts.Helpers == nil {
opts.Helpers = make(template.FuncMap)
}
opts.Helpers[name] = fn
}
}

Loading…
Cancel
Save