[TYPO3-mvc] More magic needed: disableAllHeaderCode in easy?

Steffen Kamper info at sk-typo3.de
Mon Jun 1 09:56:29 CEST 2009


Hi,

Susanne Moog schrieb:
> Hi,
> 
> Xavier Perseguers schrieb:
>> Hi,
>>
>> Steve Ryan wrote:
>>> Hi Susanne,
>>>    I've occasionally used
>>>
>>> echo "myoutput";
>>> exit;
>>>
>>> instead of a different page type although it seems to me that setting
>>> up a page type with header data disabled as you suggested is the way
>>> to go.
>> Yes, I did that recently to let users download a generated Excel file.
>> Send headers and simply exit. This is a bit rude but works actually ;-)
> 
> thanks, that's exactly what I'm doing now. Not nice but working :-)
> 
> Code:
> $this->view->assign('address', $address);
> header('Content-Type: text/x-vCard');
> header('Content-Disposition: attachment; filename= "vcard.vcf"');
> echo $this->view->render();
> exit;
> 

i agree that this is the way without loading complete CMS but i dislike 
writing such code. If core does it, it would be better like having a 
function: t3lib_div::printContentAndExit($content, $headerCode);

I use the type often as i want to use it from other parts too, like TS

vg Steffen
vg Steffen


More information about the TYPO3-project-typo3v4mvc mailing list