-
Notifications
You must be signed in to change notification settings - Fork 0
Convert and output to json
As per wikipedia, JSON is defined as: "JSON (an acronym for JavaScript Object Notation (pronounced /ˈdʒeɪsən/) is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript programming language for representing simple data structures and associative arrays, called objects. Despite its relationship to JavaScript, it is language-independent, with parsers available for virtually every programming language.[...]"
We accomplish converting our data using the Zend_Json static methods, Zend_Json::encode() and Zend_Json::decode.
The simplest use of JSON data encoding is found in our admin module's Orders controller, where data is returned to the client in JSON notation. See the /application/admin/controllers/OrdersController.php file for the jsonList() and jsonUpdate() actions.
- Next: phpUnit testing
- Previous: The Data Set, a CRUD wrapper for our Data Model
- Top: ZRECommerce Tutorials