public function Router::setOption

Sets an option.

Parameters

string $key The key:

mixed $value The value:

Throws

\InvalidArgumentException

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Router.php, line 140

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($key, $value) {
  if (!array_key_exists($key, $this->options)) {
    throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key));
  }
  $this->options[$key] = $value;
}