[TYPO3-mvc] 3 questions reagarding fluid and extbase

Franz Koch typo3.RemoveForMessage at elements-net.de
Wed Dec 1 19:49:05 CET 2010


Hey Kay,

>> is it an option to convert your json object to an array? It might not
>> contain any logic anyway, does it? So a simply "toArray" or something
>> should help to be able to use it in fluid again. You could also map it
>> to a empty domainObject that's reflecting your json object.
>>
>
> $t = (array)json_decode($resultsPlain);
> works for simple iterable lists of strings. But i do have arrays and
> objects structured with deep recursions :(
>
> How would you map it to a empty domainObject?

just the regular way by iterating over your json data and map it to php 
(domain) objects using setters. Having a little object identity cache 
you could also create recursions easily. Not sure if this is better then 
writing a custom viewHelper though - probably about the same effort.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list