src/App/Controller/Shop/HomepageController.php line 19

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Sylius package.
  4.  *
  5.  * (c) Paweł Jędrzejewski
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. declare (strict_types 1);
  11. namespace App\Controller\Shop;
  12. use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
  13. use Symfony\Component\HttpFoundation\Request;
  14. use Symfony\Component\HttpFoundation\Response;
  15. use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
  16. final class HomepageController extends ResourceController
  17. {
  18.     /** @var EngineInterface */
  19.     private $templatingEngine;
  20.     public function __construct(EngineInterface $templatingEngine)
  21.     {
  22.         $this->templatingEngine $templatingEngine;
  23.     }
  24.     
  25.     public function indexAction(Request $request): Response
  26.     {
  27.         $pageContent $this->get('App\Service\ContentService');
  28.         $pageContents $pageContent->getSections('sylius_shop_home_index');
  29.         
  30.         return $this->templatingEngine->renderResponse('@SyliusShop/Homepage/index.html.twig', [
  31.             'pageContents' => $pageContents,
  32.         ]);
  33.     }
  34. }