function PathProcessorLanguage::processOutbound

Same name in other branches
  1. 9 core/modules/language/src/HttpKernel/PathProcessorLanguage.php \Drupal\language\HttpKernel\PathProcessorLanguage::processOutbound()
  2. 10 core/modules/language/src/HttpKernel/PathProcessorLanguage.php \Drupal\language\HttpKernel\PathProcessorLanguage::processOutbound()
  3. 11.x core/modules/language/src/HttpKernel/PathProcessorLanguage.php \Drupal\language\HttpKernel\PathProcessorLanguage::processOutbound()

Overrides OutboundPathProcessorInterface::processOutbound

File

core/modules/language/src/HttpKernel/PathProcessorLanguage.php, line 104

Class

PathProcessorLanguage
Processes the inbound path using path alias lookups.

Namespace

Drupal\language\HttpKernel

Code

public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
    if (!isset($this->multilingual)) {
        $this->multilingual = $this->languageManager
            ->isMultilingual();
    }
    if ($this->multilingual) {
        $this->negotiator
            ->reset();
        $scope = 'outbound';
        if (!isset($this->processors[$scope])) {
            $this->initProcessors($scope);
        }
        foreach ($this->processors[$scope] as $instance) {
            $path = $instance->processOutbound($path, $options, $request, $bubbleable_metadata);
        }
        // No language dependent path allowed in this mode.
        if (empty($this->processors[$scope])) {
            unset($options['language']);
        }
    }
    return $path;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.