Same name in this branch
- 5.0.x advagg_bundler/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_bundler\EventSubscriber\MinificationSubscriber::minify()
- 5.0.x advagg_css_minify/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_css_minify\EventSubscriber\MinificationSubscriber::minify()
Same name in other branches
- 6.0.x advagg_bundler/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_bundler\EventSubscriber\MinificationSubscriber::minify()
- 6.0.x advagg_css_minify/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_css_minify\EventSubscriber\MinificationSubscriber::minify()
- 6.0.x advagg_js_minify/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_js_minify\EventSubscriber\MinificationSubscriber::minify()
- 8.x-3.x advagg_bundler/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_js_minify\EventSubscriber\MinificationSubscriber::minify()
- 8.x-3.x advagg_css_minify/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_css_minify\EventSubscriber\MinificationSubscriber::minify()
- 8.x-3.x advagg_js_minify/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_js_minify\EventSubscriber\MinificationSubscriber::minify()
- 8.x-4.x advagg_bundler/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_bundler\EventSubscriber\MinificationSubscriber::minify()
- 8.x-4.x advagg_css_minify/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_css_minify\EventSubscriber\MinificationSubscriber::minify()
- 8.x-4.x advagg_js_minify/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_js_minify\EventSubscriber\MinificationSubscriber::minify()
Pass the minification over to the minification service.
Paramètres
\Drupal\advagg\Asset\AssetOptimizationEvent $asset: The optimization event.
Fichier
-
advagg_js_minify/
src/ EventSubscriber/ MinificationSubscriber.php, line 37
Classe
- MinificationSubscriber
- Subscribe to asset optimization events and minify assets.
Namespace
Drupal\advagg_js_minify\EventSubscriberCode
public function minify(AssetOptimizationEvent $asset) {
$content = $asset->getContent();
$content = $this->minifier
->optimize($content, $asset->getAsset(), $asset->getData());
$this->minifier
->addLicense($content, $asset->getAsset()['data']);
$asset->setContent($content);
}