Skip to content

Latest commit

 

History

History
49 lines (30 loc) · 933 Bytes

Loader.md

File metadata and controls

49 lines (30 loc) · 933 Bytes

Loader Documentation

\Greg\View\Loader is a special loader for Renderer which will give access only to its public properties and methods.

Example:

$viewer = new \Greg\View\Viewer(__DIR__ . '/views');

$renderer = new \Greg\View\Renderer($viewer, __DIR__ . '/welcome.php', [
    'name' => 'Greg',
]);

$content = (new \Greg\View\Loader($renderer))->_l_o_a_d_();

Table of contents:

Magic methods:

__construct

Initialize the loader.

__construct(Renderer $renderer);

$renderer - An instance of Renderer;

Methods:

_l_o_a_d_

Load Renderer.

_l_o_a_d_(): string

Why it's name is so ugly?
It's simple. To avoid collision and avoid using it as a directive in templates.