You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a new Symfony 7 install it threw an error until I added the leading slash pdfAction(\Knp\Snappy\Pdf $knpSnappyPdf)
use Knp\Bundle\SnappyBundle\Snappy\Response\PdfResponse;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class SomeController extends AbstractController
{
public function pdfAction(**\**Knp\Snappy\Pdf $knpSnappyPdf)
{
$html = $this->renderView('MyBundle:Foo:bar.html.twig', array(
'some' => $vars
));
return new PdfResponse(
$knpSnappyPdf->getOutputFromHtml($html),
'file.pdf'
);
}
}
The text was updated successfully, but these errors were encountered:
In a new Symfony 7 install it threw an error until I added the leading slash pdfAction(\Knp\Snappy\Pdf $knpSnappyPdf)
The text was updated successfully, but these errors were encountered: