app/Customize/Controller/GuideController.php line 51

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Customize\Controller;
  13. use Eccube\Controller\AbstractController;
  14. use Eccube\Repository\LayoutRepository;
  15. use Eccube\Entity\Layout;
  16. use Eccube\Repository\BaseInfoRepository;
  17. use Symfony\Component\HttpFoundation\Request;
  18. use Symfony\Component\Routing\Annotation\Route;
  19. use Customize\Helper\PageHelper;
  20. class GuideController extends AbstractController
  21. {
  22.     /**
  23.      * @var LayoutRepository
  24.      */
  25.     protected $layoutRepository;
  26.     /**
  27.      * @var BaseInfoRepository
  28.      */
  29.     protected $baseInfoRepository;
  30.     /**
  31.      * GuideController constructor.
  32.      *
  33.      * @param LayoutRepository $layoutRepository
  34.      * @param BaseInfoRepository $baseInfoRepository
  35.      */
  36.     public function __construct(LayoutRepository $layoutRepositoryBaseInfoRepository $baseInfoRepository)
  37.     {
  38.         $this->layoutRepository $layoutRepository;
  39.         $this->baseInfoRepository $baseInfoRepository;
  40.     }
  41.     /**
  42.      * @Route("/users-guide", name="users_guide", methods={"GET"})
  43.      */
  44.     public function index(Request $request)
  45.     {
  46.         $Layout $this->layoutRepository->get(Layout::DEFAULT_LAYOUT_UNDERLAYER_PAGE);
  47.         $baseInfo $this->baseInfoRepository->get();
  48.         $customParams PageHelper::getPageParams('guide', [
  49.             'page_title' => 'Guide',
  50.             'page_description' => 'User guide and information',
  51.             'show_company_info' => true,
  52.             'canonical_url' => $this->generateUrl('users_guide'),
  53.             'custom_meta_tags' => [
  54.                 'og:type' => 'website',
  55.                 'og:title' => 'Guide - ' $baseInfo->getShopName(),
  56.                 'og:description' => 'User guide and information',
  57.                 'og:url' => $this->generateUrl('users_guide', [], \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL),
  58.             ],
  59.         ]);
  60.         return $this->render('Guide/index.twig', [
  61.             'Layout' => $Layout,
  62.             'custom_params' => $customParams,
  63.         ]);
  64.     }
  65. }