PHP code example of saxulum / saxulum-assetic-twig-provider

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

    

saxulum / saxulum-assetic-twig-provider example snippets

 {.php}
$app->register(new TwigServiceProvider());

$app['twig.loader.filesystem'] = $app->share($app->extend('twig.loader.filesystem',
    function (\Twig_Loader_Filesystem $twigLoaderFilesystem) {
        $twigLoaderFilesystem->addPath('/path/to/the/views', 'SomeNamespace');

        return $twigLoaderFilesystem;
    }
));

$app->register(new AsseticTwigProvider(), array(
    'assetic.asset.root' => '/path/to/project/root',
    'assetic.asset.asset_root' => '/path/to/asset/root',
));
 {.php}
$app['assetic.filters'] = $container->share(
    $app->extend('assetic.filters', function ($filters) use ($app) {
        $filters['cssmin'] = false;
        return $filters;
    })
);
 {.php}
$container['assetic.filterinstances'] = $container->share(
    $app->extend('assetic.filterinstances', function ($filterInstances) use ($container) {
        $filterInstances['jsminplus'] = new JSMinPlusFilter();

        return $filterInstances;
    })
);