Minify class
Framework\Minify\Minify
Class Minify.
Defined in libraries/minify/src/Minify.php
Methods #
- all()
- Minify all contents, optionally can disable any.
- css()
- Minify CSS.
- html()
- Minify HTML.
- js()
- Minify JavaScript.
all()
public static function all(string $contents, bool $enableHtml = true, bool $enableJs = true, bool $enableCss = true): string
Minify all contents, optionally can disable any.
Make preference to use html() if you have not css and js code and have HTML5 tags.
Parameters
- string $contents
- bool $enableHtml
- bool $enableJs
- bool $enableCss
Returns
string
css()
public static function css(string $input): string
Minify CSS.
Parameters
- string $input
Returns
string
html()
public static function html(string $input): string
Minify HTML.
Parameters
- string $input
Returns
string
js()
public static function js(string $input): string
Minify JavaScript.
Be careful:
This method doesn't support "javascript automatic semicolon insertion", you must add
semicolon by yourself, otherwise your javascript code will not work and generate error
messages.
Parameters
- string $input
Returns
string