PHP code example of adhocore / twig-yall

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

    

adhocore / twig-yall example snippets


// Use your loader of choice
$twig = new Twig\Environment(new Twig\Loader\ArrayLoader);

// Register Yall with defaults
$twig->addExtension(new Ahc\TwigYall\Yall);

// Configuring Yall instance:
$twig->addExtension(new Ahc\TwigYall\Yall(
    'polyfillJs'  => '<custom url to polyfill>',
    'yallJs'      => '<custom url to yall.js>',
    'lazyClass'   => '<default lazy class>',
    'placeholder' => '<default placeholder image url>',
));