I am developing an application and I need to create invoices in PDF. I'm using pdfbundle and PDF files are created correctly:
public function helloAction()
{
$format = $this->get('request')->get('_format');
$name = "work!!!";
return $this->render(sprintf('miomioBundle:Venta:helloAction.%s.twig', $format), array('name' => $name));
}
But how could I store that file in the database?
解决方案
You'd be far better off storing them on disk as files and reference their location in your DB. So store:
/path/to/store/invoice_434992.pdf
in a relevant table, each with a unique filename and reference it where you need to.