leafs / veins
Veins templating engine for the Leaf PHP framework
Fund package maintenance!
Open Collective
leafsphp
Installs: 1 055
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 1
Open Issues: 0
Requires
- leafs/http: *
README
Veins is a simple, lightweight, and fast templating engine for PHP. It is designed to be easy to use and easy to extend.
Installation
You can install Veins using the Leaf CLI:
leaf install veins
Or with composer:
composer require leafs/veins
Usage
<?php require __DIR__ . '/vendor/autoload.php'; use Leaf\Veins; $veins = new Veins(); $veins->configure([ 'templateDir' => __DIR__ . '/views/', 'cacheDir' => __DIR__ . '/cache/', ]); $veins->render('hello', ['name' => 'John']);
<!-- views/hello.php --> <h1>Hello, {$name}!</h1>
Configuration
You can configure Veins by passing an array to the configure
method:
$veins->configure([ 'checksum' => [], 'charset' => 'UTF-8', 'debug' => false, 'templateDir' => 'views/', 'cacheDir' => 'cache/', 'baseUrl' => '', 'phpEnabled' => false, 'autoEscape' => true, 'sandbox' => true, 'removeComments' => false, 'customTags' => [], ]);
Find the full documentation at leafphp.dev/modules/views/veins.