PHP code example of rareloop / primer-template-engine-twig

1. Go to this page and download the library: Download rareloop/primer-template-engine-twig 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/ */

    

rareloop / primer-template-engine-twig example snippets


    $primer = Primer::start(array(
        'basePath' => __DIR__.'/..', 
        'templateClass' => Rareloop\Primer\TemplateEngine\Twig\Template::class,
    ));
    

    $primer = Primer::start([
        'basePath' => __DIR__.'/..',
    
        'templateClass' => TwigTemplateEngine::class,
        'wrapTemplate' => false,
    ]);
    

$primer = Primer::start(array(
    'basePath' => __DIR__.'/..', 
    'cachePath' => 'absolute/path/to/cache/dir',
    'templateClass' => Rareloop\Primer\TemplateEngine\Twig\Template::class,
));


    Event::listen('twig.init', function ($twig) {

    });