Download the PHP package axy/min-html without Composer
On this page you can find all versions of the php package axy/min-html. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Vendor axy
Package min-html
Short Description Compress HTML
License MIT
Homepage https://github.com/axypro/min-html
Package min-html
Short Description Compress HTML
License MIT
Homepage https://github.com/axypro/min-html
Please rate this library. Is it a good library?
Informations about the package min-html
axy\min\html
Compress HTML.
- The library does not require any dependencies.
- Tested on PHP 5.4+, PHP 7, HHVM (on Linux), PHP 5.5 (on Windows).
- Install:
composer require axy/min-html
. - License: MIT.
Compression
Simply removes the indentation at the beginning and end of lines. With some exceptions:
- Indents inside some tags (as
<pre>
and<textarea>
) are relevant. - The content of some tags can be handled in a special way (compress for
<script>
and<style>
for example).
Example
The source content:
The compressed content:
API
The library defines the single public class axy\min\html\HTMLMinifier
.
Methods:
__construct(string $content [, array $tags])
run(void): string
getOriginContent(void): string
getCompressedContent(void): string
getTags(void): array
Static methods:
compress(string $content [, array $tags]): string
compressFromFile(string $content [, array $tags]): string
compressFile(string $source, string $destination [, array $tags]): string
getDefaultsTags([array $tags]): array
Example
Using static:
Without static:
Tags
The optional array tags
specifies how to handle content of the tags.
Defaults is
Argument $tags
merges with the defaults.
TRUE
- do not change.
Or callback.
All versions of min-html with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4.0
The package axy/min-html contains the following files
Loading the files please wait ....