You are here

class PathProcessorSitemapVariantOut in Simple XML sitemap 8.3

Class PathProcessorSitemapVariantOut @package Drupal\simple_sitemap\PathProcessor

Hierarchy

Expanded class hierarchy of PathProcessorSitemapVariantOut

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

File

src/PathProcessor/PathProcessorSitemapVariantOut.php, line 13

Namespace

Drupal\simple_sitemap\PathProcessor
View source
class PathProcessorSitemapVariantOut implements OutboundPathProcessorInterface {

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