Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Controller_Plugin Component Proposal

Proposed Component Name Zend_Controller_Plugin
Developer Notes
Proposers Aleksey V. Zapparov
Revision 1.1 - 14 January 2008: Initial release of proposal
1.2 - 21 May 2008: Ready for review (wiki revision: 10)

Table of Contents

1. Overview

This plugin will help to use web templates.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

4. Dependencies on Other Framework Components

  • Zend_Controller_Plugin_Abstract

5. Theory of Operation

This plugin can use simple or complex template name format.

  • Simple format is used when you don't need different representations within single template.
  • Complex format used when you want to make, for example, different templates with one design. For example it can be used to create different templates for admin panel and other part of web site but in one common design.

The use of Plugin very simple. All you have to do is - set path where your templates are stored (when initaiting new instance of object), then set template name's format and set default template name.

If you want to use Smarty with this plugin, all you have to do is extend Zend_View and setView($zend_view_smarty) where $zend_view_smarty is initiated object of Zend_View_Smarty, for more details on extending Zend_View see Zend Framework manual.

This plugin assigns all segments of $_body form Zend_Controller_Response to view's variables using their names. So if you'll appendBody() in your controller, it will be assigned to $this->default in view script.

6. Milestones / Tasks

! - TODO, ? - Idea

  • !: Add availability to fall back to default template if specified template wasn't found.
  • ?: [DONE] Rename plugin to Zend_Controller_Plugin_Template

7. Class Index

  • Zend_Controller_Plugin_Template

8. Use Cases

UC-01 (Simple)
UC-02 (Complex)

9. Class Skeletons



zend_controller zend_controller Delete
plugin plugin Delete
template template Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. May 13, 2008

    <p>Aleksey, do you plan to present this to the community for review? Does it require more work before you do so?</p>


    1. May 21, 2008

      <p>Yes. Right now it ready for review.</p>

  2. May 21, 2008


    <p>Can you talk a bit about how this proposal differs in scope from the existing Zend_Layout component?</p>


  3. May 24, 2008


    <p>Seems like I've invented a bycicle. But there were no Zend_Layout component when I was in stage of inventing <ac:emoticon ac:name="smile" />)</p>

    <p>Well, right now I've read a little about Zend_Layout and I guess in this case this proposal not needed.</p>

  4. May 24, 2008

    <p>I guess I just was unattentive... Seems like I was enventing a new bicycle when there was a motorbyke already. <ac:emoticon ac:name="smile" />)</p>