This is my code:
$invoice = Mage::getModel('sales/order_invoice')->load($invoice_id)
$block = $this->getLayout()
->createBlock('mynamespace_mymodule/pdf_invoice')
->setData('invoice', $invoice)
->setTemplate('mynamespace_mymodule/pdf/invoice.phtml');
var_dump($block->toHtml());
The result of the var_dump is empty. Smth I am missing. What should I have to check ? thx
This is the xml from layout:
<mynamespace_mymodule_pdf_index>
<reference name="content">
<block type="mynamespace_mymodule/pdf_invoice" template ="mynamespace_mymodule/pdf_invoice.phtml" output="toHtml" name="email_invoice_pdf"/>
</reference>
<mynamespace_mymodule_pdf_index>