PHP code example of kanellov / assets-manager-middleware
1. Go to this page and download the library: Download kanellov/assets-manager-middleware 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/ */
kanellov / assets-manager-middleware example snippets
php
chdir(dirname(__FILE__));
> [
'paths' => [
'some/path',
],
'web_dir' => __DIR__ . '/assets',
],
]);
$container = $app->getContainer();
// Register assets-manager-middleware in dependecy container
$container['assets'] = function ($c) {
$settings = $c->get('settings');
$config = $settings['assets'];
return new \Knlv\Middleware\AssetsManager($config);
};
// add middleware
$app->add('assets');
$app->run();