class PathProcessorManager

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/PathProcessor/PathProcessorManager.php \Drupal\Core\PathProcessor\PathProcessorManager
  2. 10 core/lib/Drupal/Core/PathProcessor/PathProcessorManager.php \Drupal\Core\PathProcessor\PathProcessorManager
  3. 9 core/lib/Drupal/Core/PathProcessor/PathProcessorManager.php \Drupal\Core\PathProcessor\PathProcessorManager
  4. 8.9.x core/lib/Drupal/Core/PathProcessor/PathProcessorManager.php \Drupal\Core\PathProcessor\PathProcessorManager

Path processor manager.

Holds an array of path processor objects and uses them to sequentially process a path, in order of processor priority.

Hierarchy

Expanded class hierarchy of PathProcessorManager

3 files declare their use of PathProcessorManager
LanguageNegotiationUserAdmin.php in core/modules/user/src/Plugin/LanguageNegotiation/LanguageNegotiationUserAdmin.php
PathProcessorTest.php in core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php
UrlGeneratorTest.php in core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
1 string reference to 'PathProcessorManager'
core.services.yml in core/core.services.yml
core/core.services.yml
1 service uses PathProcessorManager
path_processor_manager in core/core.services.yml
Drupal\Core\PathProcessor\PathProcessorManager

File

core/lib/Drupal/Core/PathProcessor/PathProcessorManager.php, line 15

Namespace

Drupal\Core\PathProcessor
View source
class PathProcessorManager implements InboundPathProcessorInterface, OutboundPathProcessorInterface {
  public function __construct(#[AutowireIterator(tag: 'path_processor_inbound')] protected readonly iterable $inboundProcessors = [], #[AutowireIterator(tag: 'path_processor_outbound')] protected readonly iterable $outboundProcessors = []) {
  }
  
  /**
   * {@inheritdoc}
   */
  public function processInbound($path, Request $request) {
    foreach ($this->inboundProcessors as $processor) {
      $path = $processor->processInbound($path, $request);
    }
    return $path;
  }
  
  /**
   * {@inheritdoc}
   */
  public function processOutbound($path, &$options = [], ?Request $request = NULL, ?BubbleableMetadata $bubbleable_metadata = NULL) {
    foreach ($this->outboundProcessors as $processor) {
      $path = $processor->processOutbound($path, $options, $request, $bubbleable_metadata);
    }
    return $path;
  }

}

Members


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