You are here

public function Url::mergeOptions in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Url.php \Drupal\Core\Url::mergeOptions()
  2. 9 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;
}