Código HTML:
Ver original
Código PHP:
Ver original
public function usuariosidAction($identificacion ,Request $request) { $em = $this->getDoctrine()->getManager(); $dql = "SELECT u FROM PPPCanBundle:Usuario u WHERE u.role != :name AND u.identificacion = :identificacion"; $usuarios = $em->createQuery($dql); $usuarios->setParameter(':name', 'ROLE_PROPIETARIO'); $usuarios->setParameter(':identificacion', $identificacion); $paginator = $this->get('knp_paginator'); $pagination = $paginator->paginate( $usuarios, $request->query->getInt('page', 1), 10000 ); $snappy = $this->get("knp_snappy.pdf"); $html = $this->renderView('PPPCanBundle:Reportes:usuariostodos.html.twig', array('pagination' => $pagination)); //inicio generar pdf $filename = "custom_pdf_from_twig"; return new Response( $snappy->getOutputFromHtml($html), 200, 'Content-Type' => 'application/pdf', 'Content-Disposition' => 'inline; filename="'.$filename.'.pdf"' ) ); }
Error:
Controller "PPP\CanBundle\Controller\ReportesController::usua riosidAction()" requires that you provide a value for the "$identificacion" argument (because there is no default value or because there is a non optional argument after this one).