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

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