Package Data | |
---|---|
Maintainer Username: | Bart van Hoekelen |
Package Create Date: | 2016-09-22 |
Package Last Update: | 2018-12-18 |
Home Page: | |
Language: | PHP |
License: | Apache-2.0 |
Last Refreshed: | 2024-11-19 03:04:39 |
Package Statistics | |
---|---|
Total Downloads: | 157 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 7 |
Total Watchers: | 3 |
Total Forks: | 1 |
Total Open Issues: | 0 |
Input
@include
, files are automatically mergedOutput
<link href='compressor/take.css' rel='stylesheet'>
and <script src='compressor/take.js'></script>
to grab itPHP compressor run (PhpCompressor::run())
compressor/
folder. Note. de destination path is without the compressor/
. This wil set in automatic
compressor/
folder as take.*
(Input) (Output)
Root/ . Root/
└── Resources/ .. ..................;;. └── Public/ (!)
└── css/ (!) .. PHP compresspr ;;;;. └── compressor/ (static)
│ ├── table.css . . .::::::::::::::::::;;:' ├── take.css
│ ├── alert.css :' └── take.js
│ ├── button.css
│ ...
└── js/ (!)
│ ├── table.js
│ ├── alert.js
│ ├── button.js
│ ...
..
(PHP compressor)
PhpCompressor::run(['resources/assets/css/', 'resources/assets/js/'], 'public/');
PhpCompressor::run( [ <loccation> , <location>, ... ], <destination> ); // explanation!
Get PHP compressor by running the composer command in the command line.
$ composer require bvanhoekelen/php-compressor
Open the AppServiceProvider.php
located in App\Providers\
.
// Add namespace at the top
use PhpCompressor\PhpCompressor;
// Place the code in the `public function boot()`.
if(config('app.debug')) // DON'T USE ON PRODUCTION !!
PhpCompressor::run(['resources/assets/css/', 'resources/assets/js/'], 'public/');
Place the code in <head>
from the html file.
<!-- PHP compressor -->
<link href="{{ asset('/compressor/take.css') }}" rel="stylesheet">
<script src="{{ asset('/compressor/take.js') }}"></script>
Get PHP compressor by running the composer command in the command line.
$ composer require bvanhoekelen/php-compressor
Run PHP compressor by place code before the view is draw.
// Require vender autoload
require_once('../vendor/autoload.php');
// Use namespace
use PhpCompressor\PhpCompressor;
// Switch which determines if environment is production
$production = false;
// Run php conpressor
if( ! $production ) // DON'T USE ON PRODUCTION !!
PhpCompressor::run(['resources/css/', 'resources/js/'], 'public/');
Place the code in <head>
from the html file.
<!-- PHP compressor -->
<link href='compressor/take.css' rel='stylesheet'>
<script src='compressor/take.js'></script>