<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[
This plugin will help to use web templates.Zend Framework: Zend_Controller_Plugin Component Proposal
Proposed Component Name
Zend_Controller_Plugin
Developer Notes
http://framework.zend.com/wiki/display/ZFDEV/Zend_Controller_Plugin
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
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
4. Dependencies on Other Framework Components
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) |
|---|
5 Comments
comments.show.hideMay 13, 2008
Wil Sinclair
<p>Aleksey, do you plan to present this to the community for review? Does it require more work before you do so?</p>
<p>,Wil</p>
May 21, 2008
Aleksey V. Zapparov
<p>Yes. Right now it ready for review.</p>
May 21, 2008
Ralph Schindler
<p>Aleksey,</p>
<p>Can you talk a bit about how this proposal differs in scope from the existing Zend_Layout component?</p>
<p>-Ralph</p>
May 24, 2008
Aleksey V. Zapparov
<p>Ooops.</p>
<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>
May 24, 2008
Aleksey V. Zapparov
<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>