function Url::mergeOptions

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Url.php \Drupal\Core\Url::mergeOptions()
  2. 8.9.x core/lib/Drupal/Core/Url.php \Drupal\Core\Url::mergeOptions()
  3. 10 core/lib/Drupal/Core/Url.php \Drupal\Core\Url::mergeOptions()

Merges the URL options with any currently set.

In the case of conflict with existing options, the new options will replace the existing options.

Parameters

array $options: The array of options. See \Drupal\Core\Url::fromUri() for details on what it contains.

Return value

$this

File

core/lib/Drupal/Core/Url.php, line 702

Class

Url
Defines an object that holds information about a URL.

Namespace

Drupal\Core

Code

public function mergeOptions($options) {
    $this->options = NestedArray::mergeDeep($this->options, $options);
    return $this;
}

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