Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 607 Bytes

File metadata and controls

31 lines (25 loc) · 607 Bytes

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>