Pure PHP views for Leaf/
You can install Veins using the Leaf CLI:
leaf install view-php
Or with composer:
composer require leafs/view-php
<?php
require __DIR__ . '/vendor/autoload.php';
use Leaf\ViewPhp;
$veins = new ViewPHP();
$veins->render('views/hello.php', ['name' => 'John']);
<!-- views/hello.php -->
<h1>Hello, {$name}!</h1>
You can configure Veins by passing an array to the configure
method:
$veins->configure([
'debug' => false,
'templateDir' => 'views/',
]);