Skip to end of metadata
Go to start of metadata

Zend Framework: Zend_Template Component Proposal

Proposed Component Name Zend_Template
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Template
Proposers Ramses Paiva - Sourcebits Technologies
Zend Liaison TBD
Revision 0.1 - 1 October 2008 (wiki revision: 27)

Table of Contents

1. Overview

The main purpose of Zend_Template is to hold in a single place an interface to manipulate the whole view environment, using layouts or not, making the job of assigning different settings (like paths, view and layout suffixes, etc) to the view environment more easier than it already is.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

Simple API to center the whole view enviroment management like:

  • Set a common directory for templates (views and layouts).
  • Set a common file suffix.
  • Set default template.
  • Change the template in use at anytime and anywhere in the application (preferencially in controllers).
  • Enable or disable layout at anytime.
  • Assign different paths for layouts and views.
  • Assign different suffixes for layouts and views
  • Assign different access rules for the views (like ':module/:controller/:action.:suffix')
  • Capacity to enable and disable it at anytime and anywhere on the application and when disabled, the default framework settings will be assumed.

4. Dependencies on Other Framework Components

  • Zend_Config
  • Zend_Controller_Action_Helper_ViewRenderer
  • Zend_Controller_Action_HelperBroker
  • Zend_Exception
  • Zend_Layout
  • Zend_View

5. Theory of Operation

Zend_Template is a singleton component to keep the view and layout settings in the whole application's life-cycle.
You can retrieve an instance throught its getInstance() method or through startMvc().

6. Milestones / Tasks

  • Milestone 1: Acceptance of Proposal.
  • Milestone 2: [DONE] Code basic interface.
  • Milestone 3: [DONE] Code main class.
  • Milestone 4: Write unit tests.
  • Milestone 5: Write documentation.
  • Milestone 6: Working prototype checked into the incubator supporting all use cases.

7. Class Index

  • Zend_Template
  • Zend_Template_Exception

8. Use Cases

9. Class Skeletons