1. Go to this page and download the library: Download b2r/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/ */
b2r / twig example snippets
use b2r\Component\Twig\Twig;
$twig = new Twig();
echo $twig
->template('hello', 'Hello, {{ name }}') // Define 'hello' template and 'hello' as current template
->name('world') // Set name context
; #=>'Hello, world' invoke __toString()