vendor/shopware/storefront/Controller/LandingPageController.php line 36

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Storefront\Controller;
  3. use Shopware\Core\Framework\Routing\Annotation\RouteScope;
  4. use Shopware\Core\Framework\Routing\Annotation\Since;
  5. use Shopware\Core\System\SalesChannel\SalesChannelContext;
  6. use Shopware\Storefront\Framework\Cache\Annotation\HttpCache;
  7. use Shopware\Storefront\Page\LandingPage\LandingPageLoadedHook;
  8. use Shopware\Storefront\Page\LandingPage\LandingPageLoader;
  9. use Symfony\Component\HttpFoundation\Request;
  10. use Symfony\Component\HttpFoundation\Response;
  11. use Symfony\Component\Routing\Annotation\Route;
  12. /**
  13.  * @RouteScope(scopes={"storefront"})
  14.  */
  15. class LandingPageController extends StorefrontController
  16. {
  17.     /**
  18.      * @var LandingPageLoader
  19.      */
  20.     private $landingPageLoader;
  21.     public function __construct(
  22.         LandingPageLoader $landingPageLoader
  23.     ) {
  24.         $this->landingPageLoader $landingPageLoader;
  25.     }
  26.     /**
  27.      * @Since("6.4.0.0")
  28.      * @HttpCache()
  29.      * @Route("/landingPage/{landingPageId}", name="frontend.landing.page", methods={"GET"})
  30.      */
  31.     public function index(SalesChannelContext $contextRequest $request): Response
  32.     {
  33.         $page $this->landingPageLoader->load($request$context);
  34.         $this->hook(new LandingPageLoadedHook($page$context));
  35.         return $this->renderStorefront('@Storefront/storefront/page/content/index.html.twig', ['page' => $page]);
  36.     }
  37. }