PHPackages                             wyrihaximus/minify-html - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wyrihaximus/minify-html

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

wyrihaximus/minify-html
=======================

Html minifier for CakePHP3

2.1.0(4y ago)18148.3k—4.3%8[2 PRs](https://github.com/WyriHaximus/MinifyHtml/pulls)1MITPHPPHP &gt;=7.2.0

Since Apr 15Pushed 8mo ago3 watchersCompare

[ Source](https://github.com/WyriHaximus/MinifyHtml)[ Packagist](https://packagist.org/packages/wyrihaximus/minify-html)[ GitHub Sponsors](https://github.com/WyriHaximus)[ RSS](/packages/wyrihaximus-minify-html/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (6)Versions (12)Used By (1)

MinifyHtml
==========

[](#minifyhtml)

CakePHP 4, HTML Minify Plugin

### Installation

[](#installation)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `~`.

```
composer require wyrihaximus/minify-html

```

Bootstrap
---------

[](#bootstrap)

Plugins are loaded in your application’s `bootstrap()` function:

```
// In src/Application.php
use Cake\Http\BaseApplication;
use WyriHaximus\MinifyHtml\Plugin as MinifyHtmlPlugin;

class Application extends BaseApplication {
    public function bootstrap()
    {
        parent::bootstrap();

        // Load the minify html plugin by class name
        $this->addPlugin(MinifyHtmlPlugin::class);
    }
}
```

### Usage

[](#usage)

After loading this plugin in your `bootstrap.php` the helper can be enabled in the `AppView` by loading the `WyriHaximus/MinifyHtml.MinifyHtml` helper like the example below:

```
class AppView extends View
{
    public function initialize(): void
    {
        $this->loadHelper('WyriHaximus/MinifyHtml.MinifyHtml');
    }
}
```

#### Note on debug

[](#note-on-debug)

When debug mode is on nothing will be minified.

### Usage in other plugins

[](#usage-in-other-plugins)

##### [dereuromark/cakephp-cache](https://github.com/dereuromark/cakephp-cache)

[](#dereuromarkcakephp-cache)

To use MinifyHtml instead of `dereuromark/cakephp-cache`'s own HTML minifier. Set the [`compress` configuration option](https://github.com/dereuromark/cakephp-cache#component-configuration) to:

```
'\WyriHaximus\MinifyHtml\compress'
```

### Configuration

[](#configuration)

All configuration is namespaced, just as this plugin into `WyriHaximus.MinifyHtml`. The following options are available:

`debugOverride` (bool) Defaults to `false`. Everwrite debug and minify when debug it on. `factory` (string) Defaults to `WyriHaximus\HtmlCompress\Factory::constructFastest`. Speficy a parser factory, `constructFastest`, `construct`, and `constructSmallest` are build in.

### License

[](#license)

Copyright 2019 [Cees-Jan Kiewiet](http://wyrihaximus.net/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance43

Moderate activity, may be stable

Popularity42

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~387 days

Recently: every ~559 days

Total

7

Last Release

1726d ago

Major Versions

1.2.1 → 2.0.02019-12-30

PHP version history (4 changes)1.0.0PHP &gt;=5.4.19

1.2.0PHP ^7.0 || ^5.6

2.0.0PHP ^7.2

2.1.0PHP &gt;=7.2.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/147145?v=4)[Cees-Jan Kiewiet](/maintainers/WyriHaximus)[@WyriHaximus](https://github.com/WyriHaximus)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (109 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (105 commits)")[![mirko-pagliai](https://avatars.githubusercontent.com/u/293199?v=4)](https://github.com/mirko-pagliai "mirko-pagliai (17 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (13 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")

---

Tags

hacktoberfesthtmlcakephpminifycompresscakephp4

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/wyrihaximus-minify-html/health.svg)

```
[![Health](https://phpackages.com/badges/wyrihaximus-minify-html/health.svg)](https://phpackages.com/packages/wyrihaximus-minify-html)
```

###  Alternatives

[voku/html-min

HTML Compressor and Minifier

1804.7M39](/packages/voku-html-min)[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

338920.1k32](/packages/dereuromark-cakephp-tools)[mrclay/jsmin-php

Provides a modified port of Douglas Crockford's jsmin.c, which removes unnecessary whitespace from JavaScript files.

5312.9M27](/packages/mrclay-jsmin-php)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k5.4k1](/packages/vinkius-labs-laravel-page-speed)[wyrihaximus/html-compress

Compress/minify your HTML

841.6M31](/packages/wyrihaximus-html-compress)[nochso/html-compress-twig

Twig extension for compressing HTML and inline CSS/Javascript

84468.6k8](/packages/nochso-html-compress-twig)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
