<?php
namespace App\Controller\Frontend;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\String\Slugger\AsciiSlugger;
use Nelmio\ApiDocBundle\Annotation\Security;
use App\Service\AgencyService;
use App\Service\BannerService;
use App\Repository\BikeRepository;
use App\Service\CircuitService;
/**
* Frontend: Frontend controller.
* @Route("/", name="frontend")
*/
class FrontendController extends AbstractController
{
/**
* @Route("/", name="_index")
*/
public function index()
{
return $this->render('index.html.twig');
}
public function banner(BannerService $BannerService)
{
$banners = $BannerService->getBanner(['type'=>'site']);
return $this->render('widget/banner.html.twig', ['banners' => $banners]);
}
public function bike(BikeRepository $BikeRepository)
{
$bikes = $BikeRepository->groupByBrand();
return $this->render('widget/bike.html.twig', ['bikes' => $bikes]);
}
public function circuit(CircuitService $CircuitService)
{
$circuits = $CircuitService->getCircuit(['statut' => true]);
return $this->render('widget/circuit.html.twig', ['circuits' => $circuits]);
}
public function agency(AgencyService $AgencyService)
{
$agencies = $AgencyService->getAgency();
return $this->render('widget/agency.html.twig', ['agencies' => $agencies]);
}
}