[TYPO3-mvc] Making JSON data from object

Roland most.wanted at gmx.at
Thu Nov 15 16:09:13 CET 2012


hi everybody,

Am 04.03.10 11:48, schrieb Søren Malling:> I need to create a json 
string from a repository but (i guess) due to
 > the use of object in the return of findAll() my json output (using
 > json_encode) looks like this
 >
 > [{},{}]
 >
 > I only got 2 results in my object, so the amount of square brackets
 > are correct, but there is no data.
 >
 > What would be the correct to solve this problem? I couldn't find any
 > thing on JSON in the extbase source or from any Google searches?

i have the same problem - any new best practices here?

i tried to use the <fed:data.json /> viewhelper [1], but i also got only 
empty brackets...

how do you create json from

(a) Tx_Extbase_Persistence_QueryResult
(b) Tx_YourExtension_Domain_Model_YourObject

kind regards

roland


[1] http://fedext.net/fed-viewhelpers/variables/json.html


More information about the TYPO3-project-typo3v4mvc mailing list