src/Controller/Pages/ContactsController.php line 40

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 Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
  21. use Doctrine\DBAL\ParameterType;
  22. class ContactsController extends AbstractKasController
  23. {
  24.     public function __construct(RequestStack $requestStackDatabase $dbPageInfo $pageInfo)
  25.     {
  26.         parent::__construct($requestStack$db$pageInfo);
  27.         $this->request $requestStack->getCurrentRequest();
  28.         $this->model = new ContactsModel($db);
  29.     }
  30.     /**
  31.      * @Route("/kontakty")
  32.      * @return Response
  33.      */
  34.     public function object(): Response
  35.     {
  36.         //throw $this->createNotFoundException(); test 404
  37.         // throw new AccessDeniedHttpException(); test 403
  38.         
  39.         //$n = $this->pageInfo->getNavbar();
  40.         //dump($n);
  41.         //$link = $this->request->getRequestUri();
  42.         //$objectinfo = $this->model->getObjectInfo($link);
  43.         //dump($objectinfo);
  44.         //pokud nenalezeno, tak 404
  45.         /*if (!$objectinfo->isFound()) return $this->render('/pages/404.html.twig', [
  46.             'pageinfo' => $this->pageInfo
  47.         ]);*/
  48.         //obrazek pozadi
  49.         $folder 'www_objects';
  50.         $picture = new Picture($folder);
  51.         $picture->setFileName('24d34fd9468665b1e06c9c64c0945838.jpg');
  52.         //obrazek pozadi
  53.         $folder 'www_webpages';
  54.         $background = new Picture($folder);
  55.         $background->setFileName(md5('webpage_5').'.jpg');
  56.         $main_contacts $this->model->getContacts(true);
  57.         //dump($main_contacts);
  58.         $next_contacts $this->model->getContacts(false);
  59.         //dump($next_contacts);
  60.         $object_contacts $this->model->getObjectContacts();
  61.         //dump($object_contacts);
  62.         return $this->render('/pages/contacts.html.twig', [
  63.             'pageinfo' => $this->pageInfo,
  64.             'picture' => $picture,
  65.             'background' => $background,
  66.             'main_contacts' => $main_contacts,
  67.             'next_contacts' => $next_contacts,
  68.             'object_contacts' => $object_contacts,
  69.         ]);
  70.     }
  71. }
  72. ?>