src/Controller/Pages/ContactsController.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\Picture;
  5. use App\Controller\System;
  6. use App\Kernel;
  7. use App\Controller\AbstractKasController;
  8. use App\Controller\AbstractKasModel;
  9. use App\Controller\Database;
  10. use App\Controller\PageInfo;
  11. use Symfony\Bundle\FrameworkBundle\Console\Application;
  12. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  13. use Symfony\Component\Cache\Adapter\MemcachedAdapter;
  14. use Symfony\Component\Console\Input\ArrayInput;
  15. use Symfony\Component\Console\Output\BufferedOutput;
  16. use Symfony\Component\HttpFoundation\RequestStack;
  17. use Symfony\Component\Routing\Annotation\Route;
  18. use Symfony\Component\HttpFoundation\Response;
  19. use Symfony\VarDumper;
  20. use Doctrine\DBAL\ParameterType;
  21. class ContactsController extends AbstractKasController
  22. {
  23.     public function __construct(RequestStack $requestStackDatabase $dbPageInfo $pageInfo)
  24.     {
  25.         parent::__construct($requestStack$db$pageInfo);
  26.         $this->request $requestStack->getCurrentRequest();
  27.         $this->model = new ContactsModel($db);
  28.     }
  29.     /**
  30.      * @Route("/kontakty")
  31.      * @return Response
  32.      */
  33.     public function object(): Response
  34.     {
  35.         //$n = $this->pageInfo->getNavbar();
  36.         //dump($n);
  37.         //$link = $this->request->getRequestUri();
  38.         //$objectinfo = $this->model->getObjectInfo($link);
  39.         //dump($objectinfo);
  40.         //pokud nenalezeno, tak 404
  41.         /*if (!$objectinfo->isFound()) return $this->render('/pages/404.html.twig', [
  42.             'pageinfo' => $this->pageInfo
  43.         ]);*/
  44.         //obrazek pozadi
  45.         $folder 'www_objects';
  46.         $picture = new Picture($folder);
  47.         $picture->setFileName('24d34fd9468665b1e06c9c64c0945838.jpg');
  48.         //obrazek pozadi
  49.         $folder 'www_webpages';
  50.         $background = new Picture($folder);
  51.         $background->setFileName(md5('webpage_5').'.jpg');
  52.         $main_contacts $this->model->getContacts(true);
  53.         //dump($main_contacts);
  54.         $next_contacts $this->model->getContacts(false);
  55.         //dump($next_contacts);
  56.         $object_contacts $this->model->getObjectContacts();
  57.         //dump($object_contacts);
  58.         return $this->render('/pages/contacts.html.twig', [
  59.             'pageinfo' => $this->pageInfo,
  60.             'picture' => $picture,
  61.             'background' => $background,
  62.             'main_contacts' => $main_contacts,
  63.             'next_contacts' => $next_contacts,
  64.             'object_contacts' => $object_contacts,
  65.         ]);
  66.     }
  67. }
  68. ?>