PHP code example of leafs / veins

1. Go to this page and download the library: Download leafs/veins library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

leafs / veins example snippets




eaf\Veins;

$veins = new Veins();
$veins->configure([
    'templateDir' => __DIR__ . '/views/',
    'cacheDir' => __DIR__ . '/cache/',
]);
$veins->render('hello', ['name' => 'John']);

$veins->configure([
    'checksum' => [],
    'charset' => 'UTF-8',
    'debug' => false,
    'templateDir' => 'views/',
    'cacheDir' => 'cache/',
    'baseUrl' => '',
    'phpEnabled' => false,
    'autoEscape' => true,
    'sandbox' => true,
    'removeComments' => false,
    'customTags' => [],
]);
html
<!-- views/hello.php -->
<h1>Hello, {$name}!</h1>