dabl/view

Simple PHP view renderer

v1.0.3 2017-04-30 02:56 UTC

This package is auto-updated.

Last update: 2024-04-04 08:16:41 UTC


README

Build Status

Dabl View

Simple class for rendering pure PHP views

Example

app.php:

use Dabl\View\View;

View::addDirectory(__DIR__ . '/views');
$output = View::load(
    'view', // view name
    array(
        'my_param' => 'hello world' // param to be injecting into the view
    ),
    true // return output instead of sending output to browser
);
echo $output;

views/view.php:

<div><?= $my_param ?></div>

output:

<div>hello world</div>