OK, I kinda figured this out. I change the Layout in the model layer:
$this->_helper->layout->setLayout('layout-excel');
created a layout file called layout-excel.phtml which writes the corrected
header and the contents of the page.
Hope that helps the hive mind.
monk.e.boy
monk.e.boy wrote:
>
> Hi,
>
> I want to be able to write out an excel document. I have a table of data
> which can be exported as Excel/CSV, so the user click on the 'export' link
> which passes a GET parameter to the page.
>
> How do I change the view to output CSV rather than HTML?
>
> I am using:
>
> Zend_Layout::startMvc(array('layoutPath'=>'../application/layouts'));
>
> in my bootstrap.
>
>
> Should I use the same view to output either (HTML Report || CSV)? Should
> these be in different views?
>
> How do I remove the 'layout' from within the view layer? I don't want to
> change the bootstrap file because 100s of pages all use 'layout' and work
> fine. Shouldn't the choice to use it or not to use it be made in the View
> layer?
>
> I have no idea how to approach this :-) so any help or pointers will be
> appreciated :-)
>
> monk.e.boy
>
--
View this message in context:
http://www.nabble.com/Write-out-Excel---CSV-tp17730692p17732936.html
Sent from the Zend Framework mailing list archive at Nabble.com.