<?php
namespace App\Controller;
use App\Entity\Menu;
use App\Repository\MenuRepository;
use App\Repository\PublicationRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class LibrairieController extends AbstractController
{
#[Route('/librairie', name: 'app_librairie')]
public function index(): Response
{
return $this->render('librairie/index.html.twig', [
'controller_name' => 'LibrairieController',
]);
}
public function afficherSidebar()
{
return $this->render('default/sidebar.html.twig');
}
public function afficherSlide(PublicationRepository $publicationRepository)
{
$publications = $publicationRepository->findBy(['estSlide' => true]);
return $this->render('default/slide.html.twig', compact('publications'));
}
public function afficherAproposAccueil(PublicationRepository $publicationRepository)
{
$publications = $publicationRepository->findBy(['menu' => 6]);
return $this->render('default/sessionapropos.html.twig', compact('publications'));
}
public function afficherServicesAccueil(PublicationRepository $publicationRepository)
{
$publications = $publicationRepository->findBy(['menu' => 3],[],3);
return $this->render('default/sessionservice.html.twig', compact('publications'));
}
public function afficherStatistiqueAccueil(PublicationRepository $publicationRepository)
{
$publications = $publicationRepository->findBy(['menu' => 8]);
return $this->render('default/sessionstatistique.html.twig', compact('publications'));
}
public function afficherSession(PublicationRepository $publicationRepository, $id = null)
{
$publications = $publicationRepository->findBy(['menu' => ($id)? $id : 0 ]);
return $this->render('default/slide.html.twig', compact('publications'));
}
public function afficherAriane(PublicationRepository $publicationRepository, Menu $menu)
{
// $publications = $publicationRepository->findBy(['menu' => ($id)? $id : 0 ]);
$publications = '';
return $this->render('default/ariane.html.twig', compact('publications','menu'));
}
public function afficherFooter(PublicationRepository $publicationRepository)
{
// $publications = $publicationRepository->findBy(['menu' => ($id)? $id : 0 ]);
$publications = '';
return $this->render('default/footer.html.twig', compact('publications'));
}
public function afficherMenu(MenuRepository $menuRepository, $menuactive = null)
{
$menus = $menuRepository->findBy(['menuparent' => NULL, 'estMasque' => false ]);
return $this->render('default/afficherMenu.html.twig', array(
'menus' => $menus,
'menuactive' => ($menuactive) ? $menuactive->getId() : null,
));
}
// {
// $menus = $menuRepository->findBy(['menuparent' => NULL, 'estMasque' => false ]);
// return $this->render('default/afficherMenu.html.twig', array(
// 'menus' => $menus,
// ));
// }
}