PHP code example of maceda / twig-composer

1. Go to this page and download the library: Download maceda/twig-composer 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/ */

    

maceda / twig-composer example snippets


$this->twig = new \Twig_Environment(
$loader,
array(
     ...
     'base_template_class' => 'TwigComposer\TwigComposer',
     ...
));

TwigComposer::getNotifier()->on('Template_I_Want_To_Watch', $callback);
'Template_I_Want_To_Watch'
Relayer.php
TwigComposer.php