[TYPO3-mvc] Skip rendering of the view

Sebastian Schreiber me at schreibersebastian.de
Thu Dec 22 10:19:57 CET 2011


Am 22.12.2011 10:16, schrieb Claus Due:
> On Dec 22, 2011, at 10:03 AM, Sebastian Schreiber wrote:
>
>> Just put it a return or return NULL (it´s actually the same) in your action and you should be fine.
> And perhaps also use a typeNum to suppress the normal page rendering since it looks like Henjo would like that gone too :)
>
> Example, ext_localconf.php
> t3lib_extMgm::addTypoScript($_EXTKEY,'setup',
>    [GLOBAL]
>    page = PAGE
>    page.typeNum = 0
>    page.5 = USER
>    page.5.userFunc = tx_extbase_core_bootstrap->run
>    page.5.extensionName = Fed
>    page.5.pluginName = API
>    page.10>
> ', TRUE);
>
> Perhaps a Fluid Widget could even be used (if your content output is not cached). In rough terms it would require a Widget with AJAX enabled, a WidgetController with an action to output the .vcf and finally using<f:widget.link action="theDownloadAction" ajax="TRUE">link to file</f:widget.link>  inside the template file for the Widget. This is a more complex solution but it gets around the typeNum issue.
>
> Who knows - perhaps the Widget could also be used as a general .vcf-download component others might find useful. I'll gladly accept is as a donation to FED ;)
>
> Cheers,
> Claus
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
of course. And additionally you should also send the correct response 
headers in the action or combined with your PAGE-TS-Settings:

Something like:
$this->response->setHeader('Content-Disposition', 'attachment; 
filename="' . $fileName . '.vcf"');
$this->response->setHeader('Content-Length', strlen($vCardString));
$this->response->setHeader('Connection', 'close');

-- 
Sebastian Schreiber
(Medieninformatiker B.Sc.)
(TYPO3 Certified Integrator)

Schanzenstraße 27, Schlosserei 4
D-51063 Köln

T  0221 677 88 541
M  0176 431 05 790

Skype schreibersebastian.de

me at schreibersebastian.de
www.schreibersebastian.de

Steuernummer: 217 / 5269 / 4675



More information about the TYPO3-project-typo3v4mvc mailing list