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

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.  * @Route(defaults={"_routeScope"={"storefront"}})
  14.  *
  15.  * @deprecated tag:v6.5.0 - reason:becomes-internal - Will be internal
  16.  */
  17. class LandingPageController extends StorefrontController
  18. {
  19.     /**
  20.      * @var LandingPageLoader
  21.      */
  22.     private $landingPageLoader;
  23.     /**
  24.      * @internal
  25.      */
  26.     public function __construct(
  27.         LandingPageLoader $landingPageLoader
  28.     ) {
  29.         $this->landingPageLoader $landingPageLoader;
  30.     }
  31.     /**
  32.      * @Since("6.4.0.0")
  33.      * @HttpCache()
  34.      * @Route("/landingPage/{landingPageId}", name="frontend.landing.page", methods={"GET"})
  35.      */
  36.     public function index(SalesChannelContext $contextRequest $request): Response
  37.     {
  38.         $page $this->landingPageLoader->load($request$context);
  39.         $this->hook(new LandingPageLoadedHook($page$context));
  40.         return $this->renderStorefront('@Storefront/storefront/page/content/index.html.twig', ['page' => $page]);
  41.     }
  42. }