<?php
namespace App\Controller;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Component\HttpFoundation\Response;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Request;
class headerController extends AbstractController
{
private $client;
public function __construct(HttpClientInterface $client)
{
$this->client = $client;
}
public function renderHeader()
{
if (isset($_COOKIE['client_id'])){
$id = $_COOKIE['client_id'];
$name = $_COOKIE['client_name'].' '.substr($_COOKIE['client_lastname'],0, 1);
} else {
$id = "";
$name = "";
}
return $this->render(
'/header.html.twig', array(
'client_id' => $id,
'client_name' => $name
)
);
}
/**
* @Route("/connexionUser")
*/
public function renderConnexionUser()
{
if (isset($_COOKIE['client_id'])){
$id = $_COOKIE['client_id'];
$name = $_COOKIE['client_name'].' '.substr($_COOKIE['client_lastname'], 0, 1);
} else {
$id = "";
$name = "";
}
return $this->render(
'/userHeader.html.twig', array(
'client_id' => $id,
'client_name' => $name
)
);
}
/**
* @Route("/bandeau")
*/
// public function renderBandeauCookie()
// {
// return $this->render(
// '/bandeau.html.twig', array(
// )
// );
// }
/**
* @Route("/consent-config")
*/
// public function renderConsentCookie()
// {
// return $this->render(
// '/consent-config.html.twig', array(
// )
// );
// }
}