app/Customize/Controller/TopicsController.php line 42

Open in your IDE?
  1. <?php
  2. /**
  3.  * @version EC-CUBE4系
  4.  * @copyright 株式会社 翔 kakeru.co.jp
  5.  *
  6.  * 2022年08月22日
  7.  *
  8.  * app/Customize/Controller/TopicsController.php
  9.  *
  10.  *
  11.  * トピックス
  12.  *
  13.  *
  14.  *                                        ≡≡≡┏(^o^)┛
  15.  *****************************************************/
  16. namespace Customize\Controller;
  17. use Eccube\Controller\AbstractController;
  18. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  19. use Symfony\Component\HttpFoundation\Request;
  20. use Symfony\Component\Routing\Annotation\Route;
  21. #use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  22. use Customize\Service\TopicsService;
  23. use Symfony\Component\HttpFoundation\Response;
  24. class TopicsController extends AbstractController
  25. {
  26.     protected $TopicsService;
  27.     public function __construct(TopicsService $TopicsService)
  28.     {
  29.         $this->TopicsService $TopicsService;
  30.     }
  31.     /**
  32.      *
  33.      * @Route("/topics/", name="topics", methods={"GET"})
  34.      * @Template("Topics/index.twig")
  35.      */
  36.     public function index(Request $request$Token null){
  37.         $Topics $this->TopicsService->GetTopics();
  38.         $Topic =$Topics[0];
  39.         if ($Dt =$request->get('dt')){
  40.             $Topic $this->TopicsService->GetTopics($Dt);
  41.         }
  42.         return [
  43.             'Topics' => $Topics,
  44.             'Topic'  => $Topic,
  45.             'BreadCrumbs' => [],
  46.         ];
  47.     }
  48.     /**
  49.      *
  50.      * @Route("/files/rss/rss20.xml", name="topics_rss")
  51.      * @Template("Topics/Rss.twig")
  52.      */
  53.     public function Rss(){
  54.         $Topics $this->TopicsService->GetTopics();
  55.         $response $this->render('Topics/Rss.twig', [
  56.             'Topics' => $Topics,
  57.         ]);
  58.         $response->headers->set('Content-Type''application/xml; charset=UTF-8');
  59.         return $response;
  60.     }
  61. }