<?php
namespace App\Controller;
use Sonata\SeoBundle\Seo\SeoPageInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use App\Entity\Intervention;
use App\Repository\InterventionRepository;
use App\Repository\DocteurRepository;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;
use Sonata\SeoBundle\Seo\SeoAwareTrait;
class HomeController extends AbstractController {
/**
* @return RedirectResponse
*/
#[Route('/' , name:'home_homepage')]
public function home(){
return $this->redirectToRoute('app_home_index');
}
/**
* @param Request $request
* @return Response|null
*/
#[Route('/fr', options: ['sitemap' => true])]
public function index(Request $request, TranslatorInterface $translator, SeoPageInterface $seoPage){
$locale = $request->getLocale();
$titre = "Urgence Docteurs - Téléconsultation et Consultations Médicales 24/7";
$description = "Urgence Docteurs : service médical rapide et disponible 24/7. Téléconsultation, consultation en visio ou visite à domicile, nous répondons à tous vos besoins.";
$seoPage
->setTitle($titre)
->addMeta('name', 'description', $description)
->addMeta('property', 'og:title', $titre)
->addMeta('property', 'og:description', $description)
->addMeta('property', 'og:url', $this->generateUrl('app_home_index', array(), true))
->addMeta('property', 'twitter:title', $titre)
->addMeta('property', 'twitter:description', $description)
;
$this->get('session')->remove('iframe');
return $this->render('Home/index.html.twig');
}
public function comptaAction(InterventionRepository $interventionRepository){
$filter['dateBegin'] = date('2021-m-01',strtotime('this month'));
$filter['dateEnd'] = date('Y-m-31',strtotime('this month'));
$interventions = $interventionRepository->findInterventionComptaFilter($filter);
//$interventionRepository->findInterventionComptaFilter(['']);
return $this->render('Home/compta.html.twig', [
'interventions' => $interventions
]);
}
}