christianklisch / slim-minify
Minify html output in slim framework
Installs: 29 269
Dependents: 1
Suggesters: 0
Security: 0
Stars: 37
Watchers: 3
Forks: 9
Open Issues: 3
Requires
- php: >=7.2.0
- slim/slim: >=4.0.0
README
Slim middleware to minify HTML output generated by the slim PHP framework. It removes whitespaces, empty lines, tabs beetween html-tags and comments to reduce traffic. This script is a summary of stackoverflow answers.
Requirements
- PHP Version >= 7.2
- Slim Version >= 4.0
Usage
Copy the file Minify.php to 'Slim/Middleware/'. Register minify via $app->add():
or use the composer:
"require": {
"christianklisch/slim-minify": "0.7.0"
}
in 'src/middleware.php':
$app->add(new \Slim\Middleware\Minify() );
to deactivate minified output:
$app->add(new \Slim\Middleware\Minify(false);
Contributors
- Christian Klisch https://www.christian-klisch.de
Copyright and license
Copyright 2014 released under MIT license.