You are here

protected function MinificationSubscriber::isEnabled in Advanced CSS/JS Aggregation 8.3

Same name and namespace in other branches
  1. 8.4 advagg_ext_minify/src/EventSubscriber/MinificationSubscriber.php \Drupal\advagg_ext_minify\EventSubscriber\MinificationSubscriber::isEnabled()

Check if the external minifier is enabled & configured for this asset type.

Parameters

string $type: The asset type.

Return value

bool Whether to run the external minifier or not.

2 calls to MinificationSubscriber::isEnabled()
MinificationSubscriber::minifyCss in advagg_ext_minify/src/EventSubscriber/MinificationSubscriber.php
Pass the minification over to the minification service.
MinificationSubscriber::minifyJs in advagg_ext_minify/src/EventSubscriber/MinificationSubscriber.php
Pass the minification over to the minification service.

File

advagg_ext_minify/src/EventSubscriber/MinificationSubscriber.php, line 91

Class

MinificationSubscriber
Subscribe to asset optimization events and minify assets.

Namespace

Drupal\advagg_ext_minify\EventSubscriber

Code

protected function isEnabled($type) {
  if (!$this->config
    ->get("{$type}_enabled")) {
    return FALSE;
  }
  if (!$this->config
    ->get("{$type}_cmd")) {
    return FALSE;
  }
  return TRUE;
}