src/Controller/Pages/HomeController.php line 39

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Pages;
  3. use App\Controller\Objects\HomeFacebookItem;
  4. use App\Controller\Objects\Slide;
  5. use App\Kernel;
  6. use App\Controller\AbstractKasController;
  7. use App\Controller\AbstractKasModel;
  8. use App\Controller\Database;
  9. use App\Controller\PageInfo;
  10. use Symfony\Bundle\FrameworkBundle\Console\Application;
  11. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  12. use Symfony\Component\Cache\Adapter\MemcachedAdapter;
  13. use Symfony\Component\Console\Input\ArrayInput;
  14. use Symfony\Component\Console\Output\BufferedOutput;
  15. use Symfony\Component\HttpFoundation\RequestStack;
  16. use Symfony\Component\Routing\Annotation\Route;
  17. use Symfony\Component\HttpFoundation\Response;
  18. use Symfony\VarDumper;
  19. use Doctrine\DBAL\ParameterType;
  20. class HomeController extends AbstractKasController
  21. {
  22.     public function __construct(RequestStack $requestStackDatabase $dbPageInfo $pageInfo)
  23.     {
  24.         parent::__construct($requestStack$db$pageInfo);
  25.         $this->request $requestStack->getCurrentRequest();
  26.         $this->model = new HomeModel($db);
  27.     }
  28.     /**
  29.      * @Route("/")
  30.      * @return Response
  31.      * @throws \Facebook\Exceptions\FacebookSDKException
  32.      */
  33.     public function index(): Response
  34.     {
  35.         //$n = $this->pageInfo->getNavbar();
  36.         //dump($n);
  37.         $top_events $this->model->getTopEvents();
  38.         $facebook_feed $this->model->getFacebookFeed();
  39.         $objects $this->model->getObjects();
  40.         $slides $this->model->getSliders();
  41.         return $this->render('index.html.twig', [
  42.             'pageinfo' => $this->pageInfo,
  43.             'top_events' => $top_events,
  44.             'facebook_feed' => $facebook_feed,
  45.             'objects' => $objects,
  46.             'slides' => $slides
  47.         ]);
  48.     }
  49. }
  50. ?>