Documentation

View
in package

The view class allows to pass a filename and a set of data for the system to generate a string containing the generated html for the view.

Tags
todo

Allow to configure the flags for caching and debugging

todo

Implement other engines than pug so we can also generate proper JSON templates

todo

Template should inherit from StreamInterface in the future so response can be sent directly from the

Table of Contents

$data  : array<string, mixed>
$file  : string
The file to be used for rendering. We currently only support pug files for this.
__construct()  : mixed
render()  : string
Generate a string from the provided template file and data.

Properties

$data

private array<string, mixed> $data

$file

The file to be used for rendering. We currently only support pug files for this.

private string $file

Methods

__construct()

public __construct(string $file, array<string|int, mixed> $data) : mixed
Parameters
$file : string
$data : array<string|int, mixed>
Return values
mixed

render()

Generate a string from the provided template file and data.

public render() : string
Return values
string

Search results