dabl/view

简单的PHP视图渲染器

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

This package is auto-updated.

Last update: 2024-09-04 09:06:52 UTC


README

Build Status

Dabl View

用于渲染纯PHP视图的简单类

示例

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>

输出

<div>hello world</div>