class PathProcessorAlias in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/PathProcessor/PathProcessorAlias.php \Drupal\Core\PathProcessor\PathProcessorAlias
Processes the inbound path using path alias lookups.
Hierarchy
- class \Drupal\Core\PathProcessor\PathProcessorAlias implements InboundPathProcessorInterface, OutboundPathProcessorInterface
Expanded class hierarchy of PathProcessorAlias
3 files declare their use of PathProcessorAlias
- PathProcessorAliasTest.php in core/
tests/ Drupal/ Tests/ Core/ PathProcessor/ PathProcessorAliasTest.php - Contains \Drupal\Tests\Core\PathProcessor\PathProcessorAliasTest.
- PathProcessorTest.php in core/
tests/ Drupal/ Tests/ Core/ PathProcessor/ PathProcessorTest.php - Contains \Drupal\Tests\Core\PathProcessor\PathProcessorTest.
- UrlGeneratorTest.php in core/
tests/ Drupal/ Tests/ Core/ Routing/ UrlGeneratorTest.php - Contains \Drupal\Tests\Core\Routing\UrlGeneratorTest.
1 string reference to 'PathProcessorAlias'
- core.services.yml in core/
core.services.yml - core/core.services.yml
1 service uses PathProcessorAlias
File
- core/
lib/ Drupal/ Core/ PathProcessor/ PathProcessorAlias.php, line 17 - Contains \Drupal\Core\PathProcessor\PathProcessorAlias.
Namespace
Drupal\Core\PathProcessorView source
class PathProcessorAlias implements InboundPathProcessorInterface, OutboundPathProcessorInterface {
/**
* An alias manager for looking up the system path.
*
* @var \Drupal\Core\Path\AliasManagerInterface
*/
protected $aliasManager;
/**
* Constructs a PathProcessorAlias object.
*
* @param \Drupal\Core\Path\AliasManagerInterface $alias_manager
* An alias manager for looking up the system path.
*/
public function __construct(AliasManagerInterface $alias_manager) {
$this->aliasManager = $alias_manager;
}
/**
* {@inheritdoc}
*/
public function processInbound($path, Request $request) {
$path = $this->aliasManager
->getPathByAlias($path);
return $path;
}
/**
* {@inheritdoc}
*/
public function processOutbound($path, &$options = array(), Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
if (empty($options['alias'])) {
$langcode = isset($options['language']) ? $options['language']
->getId() : NULL;
$path = $this->aliasManager
->getAliasByPath($path, $langcode);
}
return $path;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PathProcessorAlias:: |
protected | property | An alias manager for looking up the system path. | |
PathProcessorAlias:: |
public | function |
Processes the inbound path. Overrides InboundPathProcessorInterface:: |
|
PathProcessorAlias:: |
public | function |
Processes the outbound path. Overrides OutboundPathProcessorInterface:: |
|
PathProcessorAlias:: |
public | function | Constructs a PathProcessorAlias object. |