<?php
namespace App\Controller\Pages;
use App\Controller\Objects\HomeFacebookItem;
use App\Controller\Objects\Slide;
use App\Kernel;
use App\Controller\AbstractKasController;
use App\Controller\AbstractKasModel;
use App\Controller\Database;
use App\Controller\PageInfo;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Cache\Adapter\MemcachedAdapter;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Response;
use Symfony\VarDumper;
use Doctrine\DBAL\ParameterType;
class HomeController extends AbstractKasController
{
public function __construct(RequestStack $requestStack, Database $db, PageInfo $pageInfo)
{
parent::__construct($requestStack, $db, $pageInfo);
$this->request = $requestStack->getCurrentRequest();
$this->model = new HomeModel($db);
}
/**
* @Route("/")
* @return Response
* @throws \Facebook\Exceptions\FacebookSDKException
*/
public function index(): Response
{
//$n = $this->pageInfo->getNavbar();
//dump($n);
$top_events = $this->model->getTopEvents();
$facebook_feed = $this->model->getFacebookFeed();
$objects = $this->model->getObjects();
$slides = $this->model->getSliders();
return $this->render('index.html.twig', [
'pageinfo' => $this->pageInfo,
'top_events' => $top_events,
'facebook_feed' => $facebook_feed,
'objects' => $objects,
'slides' => $slides
]);
}
}
?>