app/Customize/Controller/TopCustomizeController.php line 44

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 Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  14. use Symfony\Component\Routing\Annotation\Route;
  15. use Symfony\Component\HttpFoundation\Request;
  16. use Eccube\Controller\AbstractController;
  17. use Eccube\Repository\ProductRepository;
  18. class TopCustomizeController extends AbstractController
  19. {
  20.   /**
  21.    * ProductRepositoryのインスタンスを保持するプロパティ
  22.    * @var ProductRepository
  23.    */
  24.   protected $productRepository;
  25.   /**
  26.    * コンストラクタでProductRepositoryのインスタンスを注入
  27.    * @param ProductRepository $productRepository
  28.    */
  29.   public function __construct(ProductRepository $productRepository)
  30.   {
  31.     $this->productRepository $productRepository;
  32.   }
  33.   /**
  34.    * @Route("/", name="homepage", methods={"GET"})
  35.    * @Template("index.twig")
  36.    */
  37.   public function index(Request $request)
  38.   {
  39.     $Result3 $this->productRepository->find(3);
  40.     $Result4 $this->productRepository->find(4);
  41.     $Result5 $this->productRepository->find(5);
  42.     $Result6 $this->productRepository->find(6);
  43.     $Result7 $this->productRepository->find(7);
  44.     $Result8 $this->productRepository->find(8);
  45.     $Result9 $this->productRepository->find(9);
  46.     $Result10 $this->productRepository->find(10);
  47.     $Result11 $this->productRepository->find(11);
  48.     $Result12 $this->productRepository->find(12);
  49.     $Result13 $this->productRepository->find(13);
  50.     $Result14 $this->productRepository->find(14);
  51.     $Result15 $this->productRepository->find(15);
  52.     $Result16 $this->productRepository->find(16);
  53.     $Result17 $this->productRepository->find(17);
  54.     $Result18 $this->productRepository->find(18);
  55.     $Result19 $this->productRepository->find(19);
  56.     $Result20 $this->productRepository->find(20);
  57.     $Result21 $this->productRepository->find(21);
  58.     $Result22 $this->productRepository->find(22);
  59.     $Result23 $this->productRepository->find(23);
  60.     $Result24 $this->productRepository->find(24);
  61.     $Result25 $this->productRepository->find(25);
  62.     $Result26 $this->productRepository->find(26);
  63.     $Result27 $this->productRepository->find(27);
  64.     $Result28 $this->productRepository->find(28);
  65.     return [
  66.       // Twigテンプレートに渡す変数「Product」に、$Sampleのデータを設定
  67.       'Product3' => $Result3,
  68.       'Product4' => $Result4,
  69.       'Product5' => $Result5,
  70.       'Product6' => $Result6,
  71.       'Product7' => $Result7,
  72.       'Product8' => $Result8,
  73.       'Product9' => $Result9,
  74.       'Product10' => $Result10,
  75.       'Product11' => $Result11,
  76.       'Product12' => $Result12,
  77.       'Product13' => $Result13,
  78.       'Product14' => $Result14,
  79.       'Product15' => $Result15,
  80.       'Product16' => $Result16,
  81.       'Product17' => $Result17,
  82.       'Product18' => $Result18,
  83.       'Product19' => $Result19,
  84.       'Product20' => $Result20,
  85.       'Product21' => $Result21,
  86.       'Product22' => $Result22,
  87.       'Product23' => $Result23,
  88.       'Product24' => $Result24,
  89.       'Product25' => $Result25,
  90.       'Product26' => $Result26,
  91.       'Product27' => $Result27,
  92.       'Product28' => $Result28
  93.     ];
  94.     
  95.   }
  96.   public function redirect2() {
  97.     $this->redirectToRoute('user_data/renewal');
  98.   }
  99. }