[Solar-talk] Moving to Solar_Json
Clay Loveless
clay at killersoft.com
Sat Sep 2 20:55:09 PDT 2006
On Sep 1, 2006, at 5:48 AM, Rodrigo Moraes wrote:
> Solar_Json works like a charm. I've disabled the php extension and the
> class has done its job.
Hi Rodrigo,
I don't recommend disabling ext/json. Solar_Json was written to use
ext/json if it is available, which will result in faster encoding/
decoding. The php-native Solar_Json encoding and decoding methods are
unit-tested against ext/json to ensure that the Solar_Json class will
behave the same way whether or not ext/json is available.
So if you've got the ability to use the native extension, I suggest
enabling it and then continuing to use Solar_Json as it sounds like
you already are.
> I'm new to this area though. The way to pass a JSON object in a form
> is to transform it in a string with something like toJSONString() [1]
> and move it to a hidden field on submission? I've done this and it
> worked: Solar_Json decoded it nicely. Just want to check if it is the
> correct way to *submit* a JSON object (I couldn't think in any other).
>
> [1] http://www.json.org/js.html
That's how I would do what you're describing, yes.
I also have the toJSONString() JavaScript-based encoder you
referenced on my list of JavaScripts to consider for bundling with
Solar.
Regards,
Clay
--
Killersoft.com
More information about the solar-talk
mailing list