protected function YamlFileLoader::parseRoute

Parses a route and adds it to the RouteCollection.

Parameters

RouteCollection $collection A RouteCollection instance:

string $name Route name:

array $config Route definition:

string $path Full path of the YAML file being processed:

1 call to YamlFileLoader::parseRoute()
YamlFileLoader::load in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php
Loads a Yaml file.

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php, line 118

Class

YamlFileLoader
YamlFileLoader loads Yaml routing files.

Namespace

Symfony\Component\Routing\Loader

Code

protected function parseRoute(RouteCollection $collection, $name, array $config, $path) {
  $defaults = isset($config['defaults']) ? $config['defaults'] : array();
  $requirements = isset($config['requirements']) ? $config['requirements'] : array();
  $options = isset($config['options']) ? $config['options'] : array();
  $host = isset($config['host']) ? $config['host'] : '';
  $schemes = isset($config['schemes']) ? $config['schemes'] : array();
  $methods = isset($config['methods']) ? $config['methods'] : array();
  $route = new Route($config['path'], $defaults, $requirements, $options, $host, $schemes, $methods);
  $collection
    ->add($name, $route);
}