You are here

class PathProcessorSitemapVariantIn in Simple XML sitemap 8.3

Class PathProcessorSitemapVariantIn @package Drupal\simple_sitemap\PathProcessor

Hierarchy

Expanded class hierarchy of PathProcessorSitemapVariantIn

1 string reference to 'PathProcessorSitemapVariantIn'
simple_sitemap.services.yml in ./simple_sitemap.services.yml
simple_sitemap.services.yml
1 service uses PathProcessorSitemapVariantIn
simple_sitemap.path_processor.variant.in in ./simple_sitemap.services.yml
Drupal\simple_sitemap\PathProcessor\PathProcessorSitemapVariantIn

File

src/PathProcessor/PathProcessorSitemapVariantIn.php, line 12

Namespace

Drupal\simple_sitemap\PathProcessor
View source
class PathProcessorSitemapVariantIn implements InboundPathProcessorInterface {

  /**
   * {@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;
  }

}

Members