1. Go to this page and download the library: Download imansa/assetter 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/ */
use Requtize\Assetter\Assetter;
use Requtize\Assetter\Collection;
$assetsCollection = [];
$collection = new Collection($assetsCollection);
$assetter = new Assetter($collection);
$assetter->
// Build default group
$group = $assetter->build();
// Build "body" group
$group = $assetter->build('body');
// Build "head" group
$group = $assetter->build('head');
// Returns both CSS and JS files
echo $group->all();
// Returns only CSS files
echo $group->css();
// Returns only JS files
echo $group->js();
// Root namespace
$assetter->registerNamespace('{ROOT}', '/web');
// Namespace for global assets
$assetter->registerNamespace('{ASSETS}', '/web/assets');
[
// This goes to HEAD, only CSS
'bootstrap.head' => [
'styles' => [ 'bootstrap.min.css' ],
'group' => 'head',
],
// This goes to BODY, all JS
'bootstrap.body' => [
'scripts' => [ 'bootstrap.min.js' ],
'group' => 'body',
],
// This mix it up together
'bootstrap' => [
'
$assetter->
html
<html>
<head>
echo $assetter->build('body')->all();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.