PHP code example of fffunction / twig-static

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

    

fffunction / twig-static example snippets


$twig->addFilter('static', new Twig_Filter_Function(
    create_static_filter('path/to/assets/', '/url/to/prepend/')
));