<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Service\ManuxiGoogleReviewsenhanced;
class FrontController extends AbstractController {
private $GReviews = null;
public function __construct(ManuxiGoogleReviewsenhanced $googleReviews)
{
$this->GReviews = $googleReviews;
}
/**
* @Route("/", name="accueil")
* @Route("/index", name="homepage")
*/
public function index(): Response {
return $this->redirect($_ENV['MODULO_URL']);
return $this->render('front/index.html.twig', array(
'controller_name' => 'FrontController::index',
));
}
public function carouselAvisGoogle()
{
$reviews = $this->GReviews->getReviews();
return $this->render('front/avisGoogle.html.twig', array(
'reviews' => $reviews,
));
}
/**
* @Route("/tarifs", name="tarifs")
*/
public function tarifs(): Response {
return $this->render('front/tarifs.html.twig', array(
'controller_name' => 'FrontController::tarifs',
));
}
/**
* @Route("/contact", name="contact")
*/
public function contact(): Response {
return $this->render('front/contact.html.twig', array(
'controller_name' => 'FrontController::contact',
));
}
public function getFosckeditorConfig(): Response {
$resource = __DIR__ . '/'.'../../'.'config/packages/fos_ckeditor.yaml';
$configValues = \Symfony\Component\Yaml\Yaml::parse(file_get_contents($resource));
$config = $configValues['fos_ck_editor'];
foreach ($config['configs'] as &$preconfig) {
unset($preconfig['baseHref']);
foreach($preconfig as $name=>&$value){
$ending = "Route";
if ($ending == substr($name, -1*strlen($ending), strlen($ending))) {
$value = $this->generateUrl($value);
}
}unset($value);
}unset($preconfig);
return $this->json($config);
}
}