gg_templating

package
v0.3.36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2025 License: BSD-3-Clause Imports: 3 Imported by: 1

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL