class SitemapPathProcessor in Simple XML sitemap 4.x
Class SitemapInboundPathProcessor
Hierarchy
- class \Drupal\simple_sitemap\PathProcessor\SitemapPathProcessor implements InboundPathProcessorInterface, OutboundPathProcessorInterface
Expanded class hierarchy of SitemapPathProcessor
1 string reference to 'SitemapPathProcessor'
1 service uses SitemapPathProcessor
File
- src/
PathProcessor/ SitemapPathProcessor.php, line 13
Namespace
Drupal\simple_sitemap\PathProcessorView source
class SitemapPathProcessor implements InboundPathProcessorInterface, OutboundPathProcessorInterface {
/**
* {@inheritdoc}
*/
public function processInbound($path, Request $request) {
$args = explode('/', $path);
if (count($args) === 3 && $args[2] === 'sitemap.xml') {
$path = '/sitemaps/' . $args[1] . '/sitemap.xml';
}
return $path;
}
/**
* {@inheritdoc}
*/
public function processOutbound($path, &$options = [], ?Request $request = NULL, ?BubbleableMetadata $bubbleable_metadata = NULL) {
$args = explode('/', $path);
if (count($args) === 4 && $args[3] === 'sitemap.xml') {
$path = '/' . $args[2] . '/sitemap.xml';
}
return $path;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SitemapPathProcessor:: |
public | function |
Processes the inbound path. Overrides InboundPathProcessorInterface:: |
|
SitemapPathProcessor:: |
public | function |
Processes the outbound path. Overrides OutboundPathProcessorInterface:: |