You are here

public function ParamConversionEnhancer::enhance in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php \Drupal\Core\Routing\Enhancer\ParamConversionEnhancer::enhance()
  2. 10 core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php \Drupal\Core\Routing\Enhancer\ParamConversionEnhancer::enhance()

File

core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php, line 41

Class

ParamConversionEnhancer
Provides a route enhancer that handles parameter conversion.

Namespace

Drupal\Core\Routing\Enhancer

Code

public function enhance(array $defaults, Request $request) {

  // Just run the parameter conversion once per request.
  if (!isset($defaults['_raw_variables'])) {
    $defaults['_raw_variables'] = $this
      ->copyRawVariables($defaults);
    $defaults = $this->paramConverterManager
      ->convert($defaults);
  }
  return $defaults;
}