TemplateEngine
interface TemplateEngine (View source)
Interface for template rendering engines such as twig or ss templates.
Methods
Set the template which will be used in the call to render()
Check if there is a template amongst the template candidates that this rendering engine can use.
Render the template string.
Render the template which was selected during instantiation or which was set via setTemplate().
Details
__construct(string|array $templateCandidates = [])
Instantiate a TemplateEngine
TemplateEngine
setTemplate(string|array $templateCandidates)
Set the template which will be used in the call to render()
bool
hasTemplate(string|array $templateCandidates)
Check if there is a template amongst the template candidates that this rendering engine can use.
string
renderString(string $template, ViewLayerData $model, array $overlay = [], bool $cache = true)
Render the template string.
Doesn't include normalisation such as inserting js/css from Requirements API - that's handled by SSViewer.
string
render(ViewLayerData $model, array $overlay = [])
Render the template which was selected during instantiation or which was set via setTemplate().
Doesn't include normalisation such as inserting js/css from Requirements API - that's handled by SSViewer.