You are here

public function CSSCompression_Combine::__construct in Advanced CSS/JS Aggregation 7

Same name and namespace in other branches
  1. 6 advagg_css_compress/css-compressor-3.x/src/lib/Combine.inc \CSSCompression_Combine::__construct()

Stash a reference to the controller on each instantiation

Parameters

(class) control: CSSCompression Controller:

File

advagg_css_compress/css-compressor-3.x/src/lib/Combine.inc, line 74

Class

CSSCompression_Combine
CSS Compressor [VERSION] [DATE] Corey Hart @ http://www.codenothing.com

Code

public function __construct(CSSCompression_Control $control) {
  $this->Control = $control;
  $this->token = CSSCompression::TOKEN;
  $this->options =& $control->Option->options;

  // Include classes if not already done so
  if (!class_exists("CSSCompression_Combine_Border", false)) {
    $path = dirname(__FILE__) . '/Combine/';
    foreach ($this->subcombines as $class) {
      require DRUPAL_ROOT . '/' . $path . $class . '.inc';
    }
  }

  // Instantiate each sub combine
  foreach ($this->subcombines as $class) {
    $full = "CSSCompression_Combine_{$class}";
    $this->{$class} = new $full($control, $this);
  }
}