src/Controller/Page/PageController.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Page;
  3. use App\Entity\Page;
  4. use App\Form\PageType;
  5. use App\Repository\PageRepository;
  6. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  7. use Symfony\Component\HttpFoundation\Request;
  8. use Symfony\Component\HttpFoundation\Response;
  9. use Symfony\Component\Routing\Annotation\Route;
  10. use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
  11. class PageController extends Controller
  12. {
  13.     /**
  14.      * @Route("/{_locale}/{slug}", name="page_show", methods={"GET"}, requirements={"_locale" = "es|en"})
  15.      * @ParamConverter("page", class="App\Entity\Page")
  16.      */
  17.     public function index(Page $page): Response
  18.     {
  19.         //EDIT 05/01/2026 SE HA CAMBIADO EL DISEÑO Y AHORA A VECES HAY UNA IMAGEN EN LA CABECERA, COMO NO ME LA QUIERO JUGAR EDITANDO LA BBDD HACEMOS ESTA PORQUERIA
  20.         $imageCabecera ""
  21.         if($page->getSlug() == "quienes-somos"){
  22.             $imageCabecera "fondo-planta.png";
  23.         }
  24.         
  25.         return $this->render('page/index.html.twig', [
  26.             'page' => $page,
  27.             'imageCabecera' => $imageCabecera,
  28.         ]);
  29.     }
  30. }