PHP code example of hulotte / renderer

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

    

hulotte / renderer example snippets


$viewPath = './views';
$environment = 'dev'; // can also be 'prod'
$extensions = [
    new TwigExtension1(),
    new TwigExtension2(),
]; // can be nullable

$twigFactory = new \Hulotte\Renderer\Twig\TwigRendererFactory;
$twig = $twigFactory($viewPath, $environment, $extensions);

$twig->render('/index.html');

$twig->render('/index.html', ['param1' => 'hello', 'param2' => 'world']);