src/Controller/PriceTableController.php line 26
<?phpnamespace App\Controller;use App\Entity\Accommodation;use App\Entity\Client;use App\Entity\Contract;use App\Entity\ContractClient;use App\Entity\Destination;use App\Repository\BoxRepository;use App\Repository\ClientRepository;use App\Repository\DestinationRepository;use App\Repository\TermRepository;use App\Service\ContractService;use App\Service\TermService;use Knp\Bundle\SnappyBundle\Snappy\Response\PdfResponse;use Knp\Snappy\Pdf;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;use Symfony\Component\HttpFoundation\Request;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Routing\Annotation\Route;class PriceTableController extends AbstractController{#[Route('/pricetable/{id}/pdf', name: 'app_pricetable_pdf')]public function pdf(int $id, Request $request, DestinationRepository $destinationRepository, Pdf $pdf): Response{$destination = $destinationRepository->find($id);if(!$destination instanceof Destination) {throw $this->createNotFoundException('Destination not found');}$html = $this->renderView('Components/Destination/pricetable.html.twig',array('destination' => $destination,'pathToAssets' => __DIR__. '/../../public/assets',));return new PdfResponse($pdf->getOutputFromHtml($html,['orientation' => 'landscape',]),$destination->getSlug() . '.pdf','application/pdf','inline');}#[Route('/pricetable/{id}/html', name: 'app_pricetable_html')]public function html(int $id, Request $request, DestinationRepository $destinationRepository): Response{$destination = $destinationRepository->find($id);if(!$destination instanceof Destination) {throw $this->createNotFoundException('Destination not found');}return $this->render('Components/Destination/pricetable.html.twig',['destination' => $destination]);}}