Documentation ¶
Index ¶
- type TemplateRenderer
- func (r *TemplateRenderer) AddDefaultTemplateFunctions()
- func (r *TemplateRenderer) AddTemplateFunction(name string, f any)
- func (r *TemplateRenderer) Parse(name, main string, patterns ...string)
- func (r *TemplateRenderer) ParsePartial(name string, patterns ...string)
- func (r *TemplateRenderer) Render(ctx *phx.Context, status int, parsed string, vm interface{}) error
- func (r *TemplateRenderer) RenderBlock(ctx *phx.Context, status int, parsed, blockName string, vm interface{}) error
- func (r *TemplateRenderer) RenderBlockWithErrors(ctx *phx.Context, status int, parsed, blockName string, vm interface{}, ...) error
- func (r *TemplateRenderer) RenderWithErrors(ctx *phx.Context, status int, parsed string, vm interface{}, ...) error
- func (r *TemplateRenderer) ShowAvailableTemplates()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TemplateRenderer ¶
type TemplateRenderer struct {
// contains filtered or unexported fields
}
func NewTemplateRenderer ¶
func NewTemplateRenderer(fs embed.FS) *TemplateRenderer
func (*TemplateRenderer) AddDefaultTemplateFunctions ¶
func (r *TemplateRenderer) AddDefaultTemplateFunctions()
func (*TemplateRenderer) AddTemplateFunction ¶
func (r *TemplateRenderer) AddTemplateFunction(name string, f any)
AddTemplateFunction registers a new template function. If you want to have default template functions you must call AddDefaultTemplateFunctions before call this funciton
func (*TemplateRenderer) Parse ¶
func (r *TemplateRenderer) Parse(name, main string, patterns ...string)
func (*TemplateRenderer) ParsePartial ¶
func (r *TemplateRenderer) ParsePartial(name string, patterns ...string)
func (*TemplateRenderer) RenderBlock ¶ added in v0.4.0
func (*TemplateRenderer) RenderBlockWithErrors ¶ added in v0.5.3
func (r *TemplateRenderer) RenderBlockWithErrors(ctx *phx.Context, status int, parsed, blockName string, vm interface{}, formErrors map[string][]core.ValidationError) error
func (*TemplateRenderer) RenderWithErrors ¶
func (r *TemplateRenderer) RenderWithErrors(ctx *phx.Context, status int, parsed string, vm interface{}, formErrors map[string][]core.ValidationError) error
func (*TemplateRenderer) ShowAvailableTemplates ¶
func (r *TemplateRenderer) ShowAvailableTemplates()
Click to show internal directories.
Click to hide internal directories.