<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Customize\Controller;
use Eccube\Controller\AbstractController;
use Eccube\Repository\LayoutRepository;
use Eccube\Entity\Layout;
use Eccube\Repository\BaseInfoRepository;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Customize\Helper\PageHelper;
class FAQController extends AbstractController
{
/**
* @var LayoutRepository
*/
protected $layoutRepository;
/**
* @var BaseInfoRepository
*/
protected $baseInfoRepository;
/**
* FAQController constructor.
*
* @param LayoutRepository $layoutRepository
* @param BaseInfoRepository $baseInfoRepository
*/
public function __construct(LayoutRepository $layoutRepository, BaseInfoRepository $baseInfoRepository)
{
$this->layoutRepository = $layoutRepository;
$this->baseInfoRepository = $baseInfoRepository;
}
/**
* @Route("/faq", name="faq", methods={"GET"})
*/
public function index(Request $request)
{
// Load default layout for underlayer pages (ID = 2)
$Layout = $this->layoutRepository->get(Layout::DEFAULT_LAYOUT_UNDERLAYER_PAGE);
// Get custom parameters using helper
$baseInfo = $this->baseInfoRepository->get();
$customParams = PageHelper::getPrivacyPolicyParams([
'page_title' => 'FAQ',
'page_description' => 'FAQ',
'show_company_info' => true,
'canonical_url' => $this->generateUrl('faq'),
'custom_meta_tags' => [
'og:type' => 'website',
'og:title' => 'FAQ - ' . $baseInfo->getShopName(),
'og:description' => 'FAQ',
'og:url' => $this->generateUrl('faq', [], \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL),
]
]);
return $this->render('FAQ/index.twig', [
'Layout' => $Layout,
'custom_params' => $customParams,
]);
}
}