PHP code example of shineunited / silex-assets
1. Go to this page and download the library: Download shineunited/silex-assets 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/ */
shineunited / silex-assets example snippets
use Silex\Application;
use ShineUnited\Silex\Assets\AssetManagerServiceProvider;
$app->register(new AssetManagerServiceProvider(), [
'assets.path' => '/path/to/assets/'
]);
echo $app['assets']->lookup('my/asset.txt');
// returns: /path/to/assets/my/asset.txt
$app['assets']->map('jquery.js', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js');
echo $app['assets']->lookup('jquery.js');
// returns: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js