PHP code example of talesoft / tale-pug

1. Go to this page and download the library: Download talesoft/tale-pug 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/ */

    

talesoft / tale-pug example snippets



use Tale\Pug;

//Include the vendor/autoload.php if you're using composer!


$renderer = new Pug\Renderer([
    'cache_path' => '/your/absolute/cache/path'
]);


$renderer = new Pug\Renderer([
    'ttl' => 3600 //Will cache the file for 3600 seconds (one hour)
]);


$renderer = new Pug\Renderer([
    'pretty' => true
]);


//Either with
$renderer = new Pug\Renderer([
    'paths' => [__DIR__.'/views']
]);

//or with
$renderer->addPath(__DIR__.'/views');


echo $renderer->render('index', [
    'title' => 'Pug is awesome!',
    'content' => 'Oh yeah, it is.'
]);