[TYPO3-mvc] Resolve fluid marker which is set in rte

Claus Fassing claus at fassing.eu
Wed Jul 25 11:35:36 CEST 2012


Am 25.07.2012 08:48, schrieb Claus Fassing:
> Am 24.07.2012 16:39, schrieb Stefan Frömken:
>> I just have a look into die view-Object. There are many setter for paths
>> and filenames. On the other hand there are many getter methods to return
>> the source of the files. But there is no method to give HTML directly to
>> the view-Object.
>
> Right, unfortunately not.
>
>>
>> So...the only idea I found, was to create a temporary file in typo3temp
>> or whereever and give this path to the view-object.
>
> Yes, one option I am on checking.
>
>>
>> The other idea is to override the view-object with your own
>> interpretation.
>
> To Extend the TemplateView class sound as a nice option too.
>
> Thank you for brainstorming Stefan.
>
> Regards Claus
>

Both options are working.

The first one work with temp. file (tempnam, writeFile, unlink_tempfile 
from div toolbox).
I create a service class for this.
http://nopaste.info/92bf28195c.html

Controller action call for this :
//$resolver = $this->objectManager->create('Tx_Swcalc_Service_Resolver', 
$product->getCalculationInfo(), array('zip' => $zip), 
$this->buildControllerContext(), $this->request);
//$content = $resolver->getContent();
//$product->setCalculationInfo($content);


The second one is more comfortable and without any tempfile operation.
I create a own TemplateView class which extend the TemplateView class 
from FLUID and tell my controller to use this instead.

Therefore I just have to override defaultViewObjectName attribute in my 
controller
protected $defaultViewObjectName = 'Tx_Swcalc_View_TemplateView';

The class contain one method The method is just a copy of render() with 
few changes.
http://nopaste.info/df72de4688.html

The second option is much better. Thank you for pointing me in this 
direction.

Regards Claus




More information about the TYPO3-project-typo3v4mvc mailing list