You are here

function csstidy::set_cfg in Advanced CSS/JS Aggregation 6

Set the value of a setting.

@access public

@version 1.0

Parameters

string $setting:

mixed $value:

Return value

bool

1 call to csstidy::set_cfg()
csstidy::csstidy in advagg_css_compress/csstidy/class.csstidy.inc
Loads standard template and sets default settings @access private @version 1.3

File

advagg_css_compress/csstidy/class.csstidy.inc, line 345

Class

csstidy
CSS Parser class

Code

function set_cfg($setting, $value = null) {
  if (is_array($setting) && $value === null) {
    foreach ($setting as $setprop => $setval) {
      $this->settings[$setprop] = $setval;
    }
    if (array_key_exists('template', $setting)) {
      $this
        ->_load_template($this->settings['template']);
    }
    return true;
  }
  else {
    if (isset($this->settings[$setting]) && $value !== '') {
      $this->settings[$setting] = $value;
      if ($setting === 'template') {
        $this
          ->_load_template($this->settings['template']);
      }
      return true;
    }
  }
  return false;
}