Labels
Zend Framework: Zend_View_Helper_Json Component Proposal
| Proposed Component Name | Zend_View_Helper_Json |
|---|---|
| Developer Notes | http://framework.zend.com/wiki/display/ZFDEV/Zend_View_Helper_Json |
| Proposers | Matthew Weier O'Phinney |
| Revision | 0.9.0 - 03 January 2008: Initial proposal release 0.9.1 - 04 January 2008: Initial code released on laboratory 0.9.2 - 08 January 2008: Updated with feedback from Zend team; no longer exits; adds action helper version; disables layouts (wiki revision: 7) |
Table of Contents
1. Overview
Zend_View_Helper_Json is a view helper for serializing data to JSON and sending an immediate JSON response to the client.
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
- This component will serialize received data to JSON.
- This component will set appropriate HTTP response headers for returning JSON data.
- This component will provide both an action helper and a view helper, preferably using common backend functionality.
- This component will disable layouts, if enabled.
- This component will not exit immediately; that will be left to the developer to implement.
4. Dependencies on Other Framework Components
- Zend_Json
- Zend_Controller_Response_Abstract (via Zend_Controller_Front)
- Zend_Controller_Action_Helper_Abstract
5. Theory of Operation
The helper is called as a normal view helper, serializes the data passed to it, sets the appropriate response header, disables layouts, and returns the serialized JSON.
Called as an action helper, it does all of the above, as well as sets the reponse body to the serialized JSON data.
6. Milestones / Tasks
- Milestone 1: [ZFPROP:DONE] Create proposal for review
- Milestone 2: [ZFPROP:DONE] Create working tests and code in laboratory
- Milestone 3: Move working tests and code to incubator
- Milestone 4: Create documentation in incubator
- Milestone 5: Publish to core
7. Class Index
- Zend_View_Helper_Json
- Zend_Controller_Action_Helper_Json
8. Use Cases
| UC-01 |
|---|
In a view script:
| UC-02 |
|---|
In an action controller:
ZF Home Page
Code Browser
Wiki Dashboard
This proposal is approved for incubator development, and the following issues are to be addressed: