Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ViewExecutable.php

function ViewExecutable::setHandlerOption

Sets an option on a handler instance.

Use this only if you have just 1 or 2 options to set; if you have many, consider getting the handler instance, adding the options and using set_item() directly.

Parameters

string $display_id: The machine name of the display.

string $type: The type of handler being set.

string $id: The ID of the handler being set.

string $option: The configuration key for the value being set.

mixed $value: The value being set.

See also

set_item()

File

core/modules/views/src/ViewExecutable.php, line 2421

Class

ViewExecutable
Represents a view as a whole.

Namespace

Drupal\views

Code

public function setHandlerOption($display_id, $type, $id, $option, $value) {
    $item = $this->getHandler($display_id, $type, $id);
    $item[$option] = $value;
    $this->setHandler($display_id, $type, $id, $item);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal