function SetDialogOptionCommand::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Ajax/SetDialogOptionCommand.php \Drupal\Core\Ajax\SetDialogOptionCommand::__construct()
  2. 8.9.x core/lib/Drupal/Core/Ajax/SetDialogOptionCommand.php \Drupal\Core\Ajax\SetDialogOptionCommand::__construct()
  3. 11.x core/lib/Drupal/Core/Ajax/SetDialogOptionCommand.php \Drupal\Core\Ajax\SetDialogOptionCommand::__construct()

Constructs a SetDialogOptionCommand object.

Parameters

string $selector: The selector of the dialog whose title will be set. If set to an empty value, the default modal dialog will be selected.

string $option_name: The name of the option to set. May be any jQuery UI dialog option. See http://api.jqueryui.com/dialog.

mixed $option_value: The value of the option to be passed to the dialog.

1 method overrides SetDialogOptionCommand::__construct()
SetDialogTitleCommand::__construct in core/lib/Drupal/Core/Ajax/SetDialogTitleCommand.php
Constructs a SetDialogTitleCommand object.

File

core/lib/Drupal/Core/Ajax/SetDialogOptionCommand.php, line 45

Class

SetDialogOptionCommand
Defines an AJAX command that sets jQuery UI dialog properties.

Namespace

Drupal\Core\Ajax

Code

public function __construct($selector, $option_name, $option_value) {
    $this->selector = $selector ? $selector : '#drupal-modal';
    $this->optionName = $option_name;
    $this->optionValue = $option_value;
}

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