[TYPO3-mvc] Making JSON data from object

Steffen Ritter info at rs-websystems.de
Thu Mar 4 12:56:56 CET 2010


Søren Malling schrieb:
>> sry... it's seems to be a problem, if you do not recognize that the stuff
>> you're reading is another language...
>>
>> did you get it from my links? or should i repeat in english... sry...
> 
> I did get that it was about the __sleep and __wakeup function, but I'm
> not sure how you would incorporate these to accomplish a json_encode
> output based on a object.
> 
> Regards,
> 
> Søren
__sleep and __wakup are functions that are called autotmatically by php 
when using serialize and unserialize. since json_encode is some kind of 
serialization and the output you've given seems like theres just no 
"stuff known about how to serialize" (empty object) i thought you might 
test __sleep. probably this will be called on json_encode, too.
If this would happen, you would have to return an assoc-array 'property' 
=> 'value' which would be json'd.


More information about the TYPO3-project-typo3v4mvc mailing list