<?php
namespace App\Controller;
use App\Entity\Accreditation;
use App\Annotation\CmsComponent;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class AccreditationDefaultController extends AbstractController
{
public function __construct(private EntityManagerInterface $em)
{}
/**
* @CmsComponent("Embed Accreditations Slider", active=true, routeName="embed_accreditations_slider")
*/
#[Route(path: '/tlb-accreditation/slider', name: 'embed_accreditations_slider')]
public function embedAccreditationsSlider(Request $request): Response
{
$accreditations = $this->em->getRepository(Accreditation::class)->findBy(['active' => true, 'deleted' => false], ['sortOrder' => 'ASC']);
return $this->render('@theme/accreditation/accreditations_slider.html.twig', [
'accreditations' => $accreditations,
]);
}
}