PHP code example of smv7 / smarty-asset-bundle

1. Go to this page and download the library: Download smv7/smarty-asset-bundle 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/ */

    

smv7 / smarty-asset-bundle example snippets




use SmartyBundler\AssetBundle;
use SmartyBundler\BundleExtension;

$combiner = new AssetBundle([
    'cache_dir'     => __DIR__ . '/cache/assets',   // must be writable
    'cache_url'     => 'https://cdn.example.com/assets',
    'document_root' => $_SERVER['DOCUMENT_ROOT'],   // 'main.tpl');

$combiner = new AssetBundle([
    // ...
    'enable_apcu' => false,
]);

// If you add a getter for CacheManager
$combiner->getCacheManager()->clearCache();