src/Controller/headerController.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Contracts\HttpClient\HttpClientInterface;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. use Symfony\Component\HttpFoundation\Request;
  9.  
  10. class headerController extends AbstractController
  11. {
  12.     private $client;
  13.     public function __construct(HttpClientInterface $client)
  14.     {
  15.         $this->client $client;
  16.     }
  17.     public function renderHeader()
  18.     {
  19.         if (isset($_COOKIE['client_id'])){
  20.             $id $_COOKIE['client_id'];
  21.             $name $_COOKIE['client_name'].' '.substr($_COOKIE['client_lastname'],01);
  22.         } else {
  23.             $id "";
  24.             $name "";
  25.         }
  26.         return $this->render(
  27.             '/header.html.twig', array(
  28.                 'client_id' => $id,
  29.                 'client_name' => $name
  30.             )
  31.         );
  32.     }
  33.     /**
  34.      * @Route("/connexionUser")
  35.      */
  36.     public function renderConnexionUser()
  37.     { 
  38.         if (isset($_COOKIE['client_id'])){
  39.             $id $_COOKIE['client_id'];
  40.             $name $_COOKIE['client_name'].' '.substr($_COOKIE['client_lastname'], 01);
  41.         } else {
  42.             $id "";
  43.             $name "";
  44.         }
  45.         return $this->render(
  46.             '/userHeader.html.twig', array(
  47.                 'client_id' => $id,
  48.                 'client_name' => $name
  49.             )
  50.         );
  51.     }
  52.     /**
  53.      * @Route("/bandeau")
  54.      */
  55.     public function renderBandeauCookie()
  56.     { 
  57.     
  58.         return $this->render(
  59.             '/bandeau.html.twig', array(
  60.                 
  61.             )
  62.         );
  63.     }
  64.     /**
  65.      * @Route("/consent-config")
  66.      */
  67.     public function renderConsentCookie()
  68.     { 
  69.     
  70.         return $this->render(
  71.             '/consent-config.html.twig', array(
  72.                 
  73.             )
  74.         );
  75.     }
  76.    
  77. }