PHP code example of ctw / ctw-middleware-htmlminifier

1. Go to this page and download the library: Download ctw/ctw-middleware-htmlminifier library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ctw / ctw-middleware-htmlminifier example snippets


use Ctw\Middleware\HtmlMinifierMiddleware\HtmlMinifierMiddleware;

// In config/pipeline.php or similar
$app->pipe(HtmlMinifierMiddleware::class);

// config/config.php
return [
    // ...
    \Ctw\Middleware\HtmlMinifierMiddleware\ConfigProvider::class,
];

use Ctw\Middleware\HtmlMinifierMiddleware\Adapter\SimpleAdapter\SimpleAdapter;

use Ctw\Middleware\HtmlMinifierMiddleware\Adapter\TidyAdapter\TidyAdapter;

use Ctw\Middleware\HtmlMinifierMiddleware\Adapter\WyriHaximusAdapter\WyriHaximusAdapter;