class

Hwaro::Content::Processors::TemplateEngine

Inherits Reference / Object

Template Engine wrapper for Crinja

Constructors

Instance methods

loader=(loader : Crinja::Loader)

Set the template loader

Source
render(template_string : String, context : TemplateContext, name : String = "", filename : String | Nil = nil) : String

Render a template string with the given context. Pass name/filename when the string came from a file so Crinja errors report file:line:col.

Source
render(template_string : String, variables : Hash(String, Crinja::Value), name : String = "", filename : String | Nil = nil) : String

Render a template string with raw hash. Pass name/filename when the string came from a file so Crinja errors report file:line:col.

Source
render_template(template_name : String, context : TemplateContext) : String

Load and render a template by name

Source
render_template(template_name : String, variables : Hash(String, Crinja::Value)) : String

Load and render a template by name with raw hash

Source