Module CustomFields Dev: Difference between revisions

Jump to navigation Jump to search
Line 93: Line 93:
The other advantage is that php objects can directly be encoded into JSON without any preprocessing, and can then as straightly be decoded from JSON back into a php object.
The other advantage is that php objects can directly be encoded into JSON without any preprocessing, and can then as straightly be decoded from JSON back into a php object.


A simple mean to encode and decode back an object into and from a storage place was the main requirement, and JSON (+ JSON libraries for PHP) meet this criteria.
A simple mean to encode and decode back an object into and from a storage place, as well as allow users to easily add/remove extra options were the main requirement, and JSON (+ JSON libraries for PHP) meet this criteria.
 
However, note that the extra options are now encoded as an associative array, so as to avoid any ambiguities (there's no associative array in JSON, they are converted to objects).


== Implementation of JSON ==
== Implementation of JSON ==
439

edits

Navigation menu