MCPcopy Create free account
hub / github.com/kataras/iris / AddVar

Method AddVar

view/jet.go:181–190  ·  view source on GitHub ↗

AddVar adds a global variable to the jet template set.

(key string, value interface{})

Source from the content-addressed store, hash-verified

179
180// AddVar adds a global variable to the jet template set.
181func (s *JetEngine) AddVar(key string, value interface{}) {
182 if s.Set != nil {
183 s.Set.AddGlobal(key, value)
184 } else {
185 if s.vars == nil {
186 s.vars = make(map[string]interface{})
187 }
188 s.vars[key] = value
189 }
190}
191
192// Reload if setted to true the templates are reloading on each render,
193// use it when you're in development and you're boring of restarting

Callers 1

AddFuncMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected