<?php
namespace App\Controller\Pages;
use App\Controller\Objects\HomeFacebookItem;
use App\Controller\Objects\Picture;
use App\Controller\System;
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 ContactsController extends AbstractKasController
{
public function __construct(RequestStack $requestStack, Database $db, PageInfo $pageInfo)
{
parent::__construct($requestStack, $db, $pageInfo);
$this->request = $requestStack->getCurrentRequest();
$this->model = new ContactsModel($db);
}
/**
* @Route("/kontakty")
* @return Response
*/
public function object(): Response
{
//$n = $this->pageInfo->getNavbar();
//dump($n);
//$link = $this->request->getRequestUri();
//$objectinfo = $this->model->getObjectInfo($link);
//dump($objectinfo);
//pokud nenalezeno, tak 404
/*if (!$objectinfo->isFound()) return $this->render('/pages/404.html.twig', [
'pageinfo' => $this->pageInfo
]);*/
//obrazek pozadi
$folder = 'www_objects';
$picture = new Picture($folder);
$picture->setFileName('24d34fd9468665b1e06c9c64c0945838.jpg');
//obrazek pozadi
$folder = 'www_webpages';
$background = new Picture($folder);
$background->setFileName(md5('webpage_5').'.jpg');
$main_contacts = $this->model->getContacts(true);
//dump($main_contacts);
$next_contacts = $this->model->getContacts(false);
//dump($next_contacts);
$object_contacts = $this->model->getObjectContacts();
//dump($object_contacts);
return $this->render('/pages/contacts.html.twig', [
'pageinfo' => $this->pageInfo,
'picture' => $picture,
'background' => $background,
'main_contacts' => $main_contacts,
'next_contacts' => $next_contacts,
'object_contacts' => $object_contacts,
]);
}
}
?>