MCPcopy
hub / github.com/flosch/pongo2 / AsValue

Function AsValue

value.go:23–27  ·  view source on GitHub ↗

AsValue converts any given value to a pongo2.Value Usually being used within own functions passed to a template through a Context or within filter functions. Example: AsValue("my string")

(i any)

Source from the content-addressed store, hash-verified

21// Example:
22// AsValue("my string")
23func AsValue(i any) *Value {
24 return &Value{
25 val: reflect.ValueOf(i),
26 }
27}
28
29// AsSafeValue works like AsValue, but does not apply the 'escape' filter.
30func AsSafeValue(i any) *Value {

Callers 15

NegateMethod · 0.85
SliceMethod · 0.85
IndexMethod · 0.85
ContainsMethod · 0.85
ApplyFilterFunction · 0.85
ExecuteMethod · 0.85
EvaluateMethod · 0.85
EvaluateMethod · 0.85
EvaluateMethod · 0.85
EvaluateMethod · 0.85
EvaluateMethod · 0.85
tagLoremParserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…