src/Controller/FrontController.php line 46

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use App\Service\ManuxiGoogleReviewsenhanced;
  7. class FrontController extends AbstractController {
  8.     private $GReviews null;
  9.     public function __construct(ManuxiGoogleReviewsenhanced $googleReviews)
  10.     {
  11.         $this->GReviews $googleReviews;
  12.     }
  13.     /**
  14.      * @Route("/", name="accueil")
  15.      * @Route("/index", name="homepage")
  16.      */
  17.     public function index(): Response {
  18.         return $this->redirect($_ENV['MODULO_URL']);
  19.         return $this->render('front/index.html.twig', array(
  20.             'controller_name' => 'FrontController::index',
  21.         ));
  22.     }
  23.     public function carouselAvisGoogle()
  24.     {
  25.         $reviews $this->GReviews->getReviews();
  26.         return $this->render('front/avisGoogle.html.twig', array(
  27.             'reviews' => $reviews,
  28.         ));
  29.     }
  30.     /**
  31.      * @Route("/tarifs", name="tarifs")
  32.      */
  33.     public function tarifs(): Response {
  34.         return $this->render('front/tarifs.html.twig', array(
  35.             'controller_name' => 'FrontController::tarifs',
  36.         ));
  37.     }
  38.     /**
  39.      * @Route("/contact", name="contact")
  40.      */
  41.     public function contact(): Response {
  42.         return $this->render('front/contact.html.twig', array(
  43.             'controller_name' => 'FrontController::contact',
  44.         ));
  45.     }
  46.     public function getFosckeditorConfig(): Response {
  47.         $resource __DIR__ '/'.'../../'.'config/packages/fos_ckeditor.yaml';
  48.         $configValues \Symfony\Component\Yaml\Yaml::parse(file_get_contents($resource));
  49.         $config $configValues['fos_ck_editor'];
  50.         foreach ($config['configs'] as &$preconfig) {
  51.             unset($preconfig['baseHref']);
  52.             foreach($preconfig as $name=>&$value){
  53.                 $ending "Route";
  54.                 if ($ending == substr($name, -1*strlen($ending), strlen($ending))) {
  55.                     $value $this->generateUrl($value);
  56.                 }
  57.             }unset($value);
  58.         }unset($preconfig);
  59.         return $this->json($config);
  60.     }
  61. }