getClientIp(); $partitions = []; $client = $this->entityManager->getRepository(Client::class)->findOneBy(['ip' => $host]); if ($client) { $partitions = $client->getPartitions(); } $menuName = $client->getMenu()->getPublicUrl(); return $this->render('browser/' . $menuName . '.html.twig', [ 'ip' => $host, 'partitions' => $partitions, ]); } #[Route('/menu/{templateName}', name: 'render_menu_template')] public function renderMenu(string $templateName, Request $request): Response { $templatePath = 'browser/' . $templateName . '.html.twig'; if (!$this->twig->getLoader()->exists($templatePath)) { throw $this->createNotFoundException(sprintf('La plantilla "%s" no existe.', $templateName)); } return $this->render($templatePath, [ 'ip' => 'invitado', 'partitions' => [], ]); } }