vendor/stefandoorn/sitemap-plugin/src/Controller/SitemapIndexController.php line 28

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace SitemapPlugin\Controller;
  4. use SitemapPlugin\Filesystem\Reader;
  5. use Sylius\Component\Channel\Context\ChannelContextInterface;
  6. use Symfony\Component\HttpFoundation\Response;
  7. final class SitemapIndexController extends AbstractController
  8. {
  9.     private ChannelContextInterface $channelContext;
  10.     public function __construct(
  11.         ChannelContextInterface $channelContext,
  12.         Reader $reader
  13.     ) {
  14.         $this->channelContext $channelContext;
  15.         parent::__construct($reader);
  16.     }
  17.     public function showAction(): Response
  18.     {
  19.         $path \sprintf('%s/%s'$this->channelContext->getChannel()->getCode(), 'sitemap_index.xml');
  20.         return $this->createResponse($path);
  21.     }
  22. }