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

Xavier Perseguers typo3 at perseguers.ch
Mon Jun 1 10:53:15 CEST 2009


Hi,

>> 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);

BTW, shouldn't be the view that issue the header stuff? I mean, the view 
is responsible for its content, and I guess the type of content is its 
problem too. If you want to change the type to generate a PDF, you 
should only have to change the view you use.

Of course, the controller should know that it has to exit afterwards.

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en

One contribution a day keeps the fork away


More information about the TYPO3-project-typo3v4mvc mailing list