izartu API

View
in package

FinalYes

Render a view template inside the page layout.

Table of Contents

Methods

render()  : string
The HTML of a page: the layout, with the view template inside it.

Methods

render()

The HTML of a page: the layout, with the view template inside it.

public static render(string $template, array<string, mixed> $vars) : string

Each variable becomes a local variable of the templates, and the layout includes the view through $view. The templates use include, never include_once, so one process can render several pages, as the tests do.

Parameters
$template : string

The view's name in private/template/, without .php.

$vars : array<string, mixed>

The variables the templates read.

Tags
throws
Throwable

Whatever a template throws, with the output it had written discarded.

Return values
string —

The page's HTML.

On this page

Search results