function DisplayPluginBase::setOption

Same name and namespace in other branches
  1. 11.x core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::setOption()
  2. 10 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::setOption()
  3. 8.9.x core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::setOption()

File

core/modules/views/src/Plugin/views/display/DisplayPluginBase.php, line 994

Class

DisplayPluginBase
Base class for views display plugins.

Namespace

Drupal\views\Plugin\views\display

Code

public function setOption($option, $value) {
  if ($this->isDefaulted($option)) {
    return $this->default_display
      ->setOption($option, $value);
  }
  // Set this in two places: On the handler where we'll notice it
  // but also on the display object so it gets saved. This should
  // only be a temporary fix.
  $this->display['display_options'][$option] = $value;
  return $this->options[$option] = $value;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.