Skip to content
docsv0.1.0

TemplateEngineInterface

A pluggable view-rendering backend (e.g. Latte, Twig, plain PHP).

TemplateEngineInterface::setViewPath()

abstract public function setViewPath(string $path): void

Sets the base directory the engine resolves template paths against.

Parameters

Parameters of setViewPath()
NameTypeDescription
$pathstring

TemplateEngineInterface::render()

abstract public function render(string $template, array $params = []): string

Renders the given template with the supplied variables and returns the resulting output.

Parameters

Parameters of render()
NameTypeDescription
$templatestring
$paramsarray<string, mixed>