Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TemplatingHelper ¶
type TemplatingHelper struct { }
var Templating *TemplatingHelper
func NewTemplatingHelper ¶
func NewTemplatingHelper() (instance *TemplatingHelper)
func (*TemplatingHelper) Render ¶
func (instance *TemplatingHelper) Render(data string, allowEmpty bool, context ...interface{}) (response string)
Render processes a template string by replacing placeholders with corresponding values from the provided context. If allowEmpty is true, placeholders without matching values are replaced with empty strings; otherwise, they remain unchanged. Additional context values can be passed as variadic arguments, merged into a single context map for processing.
func (*TemplatingHelper) RenderExt ¶ added in v0.3.36
func (instance *TemplatingHelper) RenderExt(data string, allowEmpty bool, prefix, suffix string, context ...interface{}) (response string)
RenderExt processes a template string with customizable prefix and suffix for placeholders, replacing them with values from context. If allowEmpty is true, placeholders without matching values are replaced with empty strings; otherwise, they remain unchanged. Additional context is merged from variadic arguments into a single context map for processing.