src/Controller/Front/MessageController.php line 37

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Front;
  3. use App\Manager\FormClaimManager;
  4. use App\Manager\FormsManager;
  5. use App\Traits\UrlTrait;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  7. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. class MessageController extends AbstractController
  10. {
  11.     use UrlTrait;
  12.     protected array $locals;
  13.     public function __construct()
  14.     {
  15.         $this->locals['menu_active'] = '';
  16.     }
  17.     /**
  18.      * @Route("/gracias", name="thanks")
  19.      * @Template("front/messages/thanks.html.twig")
  20.      */
  21.     public function thanks(): array
  22.     {
  23.         $this->locals['message'] = 'thanks';
  24.         return $this->locals;
  25.     }
  26.     /**
  27.      * @Route("/gracias/reclamo/{uniq}", name="thanks_claim")
  28.      * @Template("front/messages/thanks.html.twig")
  29.      */
  30.     public function thanksClaim(string $uniqFormClaimManager $formClaimManagerFormsManager $formsManager): array
  31.     {
  32.         $claim $formClaimManager->findOneBy(['uniq' => $uniq]);
  33.         $forms $formsManager->find(1);
  34.         $this->locals['message'] = 'thanks_claim';
  35.         $this->locals['claim_uniq'] = $uniq;
  36.         $this->locals['claim_code'] = $claim $claim->getCode() : '';
  37.         $this->locals['forms'] = $forms;
  38.         return $this->locals;
  39.     }
  40.     /**
  41.      * @Route("/gracias/{slug}", name="thanks_slug")
  42.      * @Template("front/messages/thanks.html.twig")
  43.      */
  44.     public function thanksSlug($slug): array
  45.     {
  46.         $this->locals['message'] = 'thanks_slug';
  47.         $this->locals['slug'] = $slug;
  48.         return $this->locals;
  49.     }
  50.     /**
  51.      * @Route("/gracias/{slug}/{parameter}", name="thanks_slug_parameter")
  52.      * @Template("front/messages/thanks.html.twig")
  53.      */
  54.     public function thanksSlugParameter(string $slugstring $parameter): array
  55.     {
  56.         $this->locals['message'] = 'thanks_slug_parameter';
  57.         $this->locals['slug'] = $slug;
  58.         $this->locals['parameter'] = $parameter;
  59.         return $this->locals;
  60.     }
  61. }