mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 10:41:03 +01:00
Add wrappers for Pongo's AsValue() and AsSaveValue() by @neenar via PR: https://github.com/kataras/iris/pull/913
Former-commit-id: 06c4e4d849e994a8493308a8c33bd9f5e2c0eecc
This commit is contained in:
commit
bcd9a1bb17
|
@ -44,6 +44,18 @@ type (
|
|||
TagParser func(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Error)
|
||||
)
|
||||
|
||||
// AsValue converts any given value to a view.Value.
|
||||
// Usually being used within own functions passed to a template
|
||||
// through a Context or within filter functions.
|
||||
func AsValue(i interface{}) *Value {
|
||||
return (*Value)(pongo2.AsValue(i))
|
||||
}
|
||||
|
||||
// AsSafeValue works like AsValue, but does not apply the 'escape' filter.
|
||||
func AsSafeValue(i interface{}) *Value {
|
||||
return (*Value)(pongo2.AsSafeValue(i))
|
||||
}
|
||||
|
||||
// GetValue returns the `Value` as *pongo2.Value type.
|
||||
// This method was added by balthild at https://github.com/kataras/iris/pull/765
|
||||
func (value *Value) GetValue() *pongo2.Value {
|
||||
|
|
Loading…
Reference in New Issue
Block a user