app/Customize/Controller/TopController.php line 37

Open in your IDE?
  1. <?php
  2. namespace Customize\Controller;
  3. use Customize\Service\WordPressService;
  4. use Eccube\Controller\AbstractController;
  5. use Plugin\TabaCMS2\Repository\PostRepository;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. class TopController extends AbstractController
  9. {
  10.     /** @var WordPressService */
  11.     protected $wordPressService;
  12.     /** @var PostRepository */
  13.     protected $postRepository;
  14.     public function __construct(
  15.         WordPressService $wordPressService,
  16.         PostRepository $postRepository
  17.     ) {
  18.         $this->wordPressService $wordPressService;
  19.         $this->postRepository $postRepository;
  20.     }
  21.     /**
  22.      * @Route("/", name="homepage", methods={"GET"})
  23.      * @Template("index.twig")
  24.      */
  25.     public function index()
  26.     {
  27.         $condition = [
  28.             'public_div' => true,
  29.         ];
  30.         $news $this->postRepository->getList($conditionnull);
  31.         $special_posts $this->wordPressService->getItsukushiPosts('itsukushi_special'1);
  32.         return [
  33.             'news' => $news,
  34.             'special_posts' => $special_posts,
  35.         ];
  36.     }
  37. }