As we all know, all joomla's output mainly grouped into 4: HTML, PDF, Feed, RAW. What about if I'd like to output anything else directly from Joomla? You just have to die();
Every output in Joomla will have extra HTML elements, for now I use this trick: Output all header that you need, print out your content and finally before Joomla get in the way, execute die(). This solves my problem.
For example, try to do this in model. Since in model is where you put your data[base] management:
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=MyFile.xls");
header("Pragma: no-cache");
header("Expires: 0");
die();
I still think this is not the right way, untill then, enjoy this..
Tidak ada komentar:
Posting Komentar