[TYPO3-mvc] Getting rid of base wrap inside a controller action?

Franz Koch typo3.RemoveForMessage at elements-net.de
Sat Oct 30 15:23:52 CEST 2010


Hey,

>>> I have an action that's called by AJAX and I would like not to have the
>>> base wrap, just to return a number. I have tried several things like:
...
>>> return number_format($rate, 2, '.', '\'');
>>>
>>> But nothing seems to work.
>>>
>>> How can I get rid of it inside of the action (without Typoscript)?
>>> Someone has done it?
...
>> remove it from the layout? use antoher/no layout?
...
> If you mean you have a template set in typo3 and don't want it here because
> this is an ajax call... I know you said no typoscript but I think using a
> different page type is the best way to go for ajax.  Otherwise the other
> thing that comes to mind is using content processing hooks (but a different
> page type is much less hassle).

I'd probably try one of the following (not tested though):
- make use of the format parameter and pass a argument like json/xml/ajax
- create a layout file with this file suffix and remove all unneeded 
stuff there
- also create a template file with according suffix

If the layout will be picked wrongly (not using the format), specify it 
explicitly in your template by <f:layout name="layout.json" />

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list