Namespace
Drupal\advagg_old_ie_compatibility\EventSubscriber
Fichier
-
advagg_old_ie_compatibility/src/EventSubscriber/CssSubscriber.php
View source
<?php
namespace Drupal\advagg_old_ie_compatibility\EventSubscriber;
use Drupal\advagg\Asset\AssetOptimizationEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class CssSubscriber implements EventSubscriberInterface {
public function scan(AssetOptimizationEvent $asset) {
$asset_array = $asset->getAsset();
$asset_array['selectors'] = substr_count($asset->getContent(), '{');
$asset->setAsset($asset_array);
}
public static function getSubscribedEvents() {
return [
AssetOptimizationEvent::CSS => [
'scan',
100,
],
];
}
}
Classes
| Titre |
Deprecated |
Résumé |
| CssSubscriber |
|
Subscribe to CSs asset optimization events and count selectors. |