PHP code example of byjg / jinja-php

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

    

byjg / jinja-php example snippets


use ByJG\JinjaPhp\Template;

$templateString = <<<EOT
Hello {{ name }}
EOT;

$template = new Template($templateString);
$template->withUndefined(new DebugUndefined());  // Default is StrictUndefined

$variables = [
    'name' => 'World'
];
echo $template->render($variables);
bash
composer 
mermaid  
flowchart TD  
    byjg/jinja-php