Hi,
To generate PDFs, i used the fpdf library. In your vendor directory,
create a directory named fpdf and simply drop fpdf classes into it,
then, lets say you want to render / download a pdf from your
controller :
- in views/layouts :
create a file 'pdf_layout.php' : <?php header("Content-type:
application/pdf"); echo $content_for_layout ?>
- in controllers/orders_controller :
function invoice(){
// respond to a pdf format request
vendor('fpdf/'fpdf.php');
$this->layout('pdf');
$this->render('pdfs/invoice_template');
}
- in views/orders/
create a directory named "pdf" and a template file for your invoices
inside, ex : invoice_template.ctp.
fill your pdf invoice template with the data you need to render ( ex:
$pdf->Ln(10); $pdf->Cell(0, 10, $order['total']) ).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---