src/Controller/BranchOfficeController.php line 17
<?phpnamespace App\Controller;use App\Entity\BranchOffice;use App\Repository\AlbumRepository;use App\Repository\BranchOfficeRepository;use App\Repository\MenuCardRepository;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Routing\Annotation\Route;#[Route('/branch_office', name: 'branch_')]class BranchOfficeController extends AbstractController{#[Route('/{slug}', name: 'office')]public function index(?BranchOffice $branchOffice, AlbumRepository $albumRepository, MenuCardRepository $menuCardRepository): Response{if (!$branchOffice) {return $this->redirectToRoute('homepage');}return $this->render('branch_office/branch_office.html.twig', ['branch_office' => $branchOffice,'albums' => $albumRepository->findBy(['branchOffice' => $branchOffice]),'menus' => $menuCardRepository->findBy(['branchOffice' => $branchOffice]),]);}#[Route('/{slug}/album/{id}', name: 'album')]public function gallery(string $slug, int $id, BranchOfficeRepository $branchOfficeRepository, AlbumRepository $albumRepository){//return $this->redirectToRoute('homepage');$branchOffice = $branchOfficeRepository->findOneBy(['slug' => $slug]);$album = $albumRepository->findOneBy(['branchOffice' => $branchOffice, 'id' => $id]);return $this->render('branch_office/gallery.html.twig', ['album' => $album]);}}