PHP Slim : minifier le code html en sortie

Florian Journeau
Florian JOURNEAU 24 January 2021
Catégorie : PHP
Librairie pour minifier le code html de sortie :
composer require nochso/html-compress-twig


$app->extend('twig_theme', function($twig_theme, $ojt) {
$twig_theme->addExtension(new nochso\HtmlCompressTwig\Extension());
return $ojt_theme;});



{% htmlcompress %} ....your coding... {% endhtmlcompress %}
{{ htmlcompress('<ul> <li>') }}
{{ '<ul> <li>'|htmlcompress }}