Same name in other branches
- 6.0.x advagg_ext_minify/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_ext_minify\EventSubscriber\MinificationSubscriber::minifyJs()
- 8.x-3.x advagg_ext_minify/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_ext_minify\EventSubscriber\MinificationSubscriber::minifyJs()
- 8.x-4.x advagg_ext_minify/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_ext_minify\EventSubscriber\MinificationSubscriber::minifyJs()
Pass the minification over to the minification service.
Paramètres
\Drupal\advagg\Asset\AssetOptimizationEvent $asset: The asset optimization event.
Fichier
-
advagg_ext_minify/
src/ EventSubscriber/ MinificationSubscriber.php, line 63
Classe
- MinificationSubscriber
- Subscribe to asset optimization events and minify assets.
Namespace
Drupal\advagg_ext_minify\EventSubscriberCode
public function minifyJs(AssetOptimizationEvent $asset) {
if (!$this->isEnabled('js')) {
return;
}
$content = $asset->getContent();
$content = $this->minifier
->js($content, $asset->getAsset(), $asset->getData());
$asset->setContent($content);
}