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

Breadcrumb

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

function Router::setOption

Sets an option.

Throws

\InvalidArgumentException

File

vendor/symfony/routing/Router.php, line 117

Class

Router
The Router class is an example of the integration of all pieces of the routing system for easier use.

Namespace

Symfony\Component\Routing

Code

public function setOption(string $key, mixed $value) : void {
    if (!\array_key_exists($key, $this->options)) {
        throw new \InvalidArgumentException(\sprintf('The Router does not support the "%s" option.', $key));
    }
    $this->options[$key] = $value;
}

API Navigation

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