You are here

public function CSSCompression_Option::option in Advanced CSS/JS Aggregation 7

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

Maintainable access to the options array

- Passing no arguments returns the entire options array - Passing a single name argument returns the value for the option - Passing both a name and value, sets the value to the name key, and returns the value - Passing an array will merge the options with the array passed, for object like extension

Parameters

(mixed) name: The key name of the option:

(mixed) value: Value to set the option:

File

advagg_css_compress/css-compressor-3.x/src/lib/Option.inc, line 42

Class

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

Code

public function option($name = NULL, $value = NULL) {
  if ($name === NULL) {
    return $this->options;
  }
  else {
    if (is_array($name)) {
      return $this
        ->merge($name);
    }
    else {
      if ($value === NULL) {
        return isset($this->options[$name]) ? $this->options[$name] : NULL;
      }
      else {

        // Readability doesn't signify custom settings
        if ($name != 'readability') {
          $this->Control->mode = $this->custom;
        }
        return $this->options[$name] = $value;
      }
    }
  }
}