montessori-ressources / web

Montessori Ressources full stack webapp based on PHP Symfony
MIT License
2 stars 0 forks source link

Cannot see PDF ! #76

Closed julbrs closed 4 years ago

julbrs commented 4 years ago

Describe the bug

No PDF is shown on alpha !

julbrs commented 4 years ago

I have this error in prod.log on server:

[2019-10-24 00:59:25] request.CRITICAL: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\ControllerDoesNotReturnResponseException: "The controller must return a "Symfony\Component\HttpFoundation\Response" object but it returned null. Did you forget to add a return statement somewhere in your controller?" at /home3/ressourcesmont/web/src/Controller/CardController.php line 198 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\ControllerDoesNotReturnResponseException(code: 0): The controller must return a \"Symfony\\Component\\HttpFoundation\\Response\" object but it returned null. Did you forget to add a return statement somewhere in your controller? at /home3/ressourcesmont/web/src/Controller/CardController.php:198)"} []
julbrs commented 4 years ago

fixed by doing:

$response = $dompdf->getStreamResponse($html, "card.pdf", [
        "Attachment" => false
      ]);
      return $response;

I am happy !