<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_View_Helper_Cycle is a simple component which cycles through a series of values based on an iteration number.Zend Framework: Zend_View_Helper_Cycle Component Proposal
Proposed Component Name
Zend_View_Helper_Cycle
Developer Notes
http://framework.zend.com/wiki/display/ZFDEV/Zend_View_Helper_Cycle
Proposers
Kamil Nowakowski
Matthew Weier O'Phinney (Zend Liaison)
Revision
0.1 - 5 April 2008: Initial proposal (wiki revision: 22)
Table of Contents
1. Overview
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
4. Dependencies on Other Framework Components
- none
5. Theory of Operation
- You can cycle in both ways (normal or backwards) through the array
6. Milestones / Tasks
- Milestone 1:[DONE] Create proposal
- Milestone 2: Community [DONE] and Zend review
- Milestone 3: Unit tests exist, work, and are checked into SVN.
- Milestone 4: Initial documentation exists.
7. Class Index
- Zend_View_Helper_Cycle
8. Use Cases
| UC-01 |
|---|
output
| UC-02 |
|---|
In backwards order
10 Comments
comments.show.hideApr 05, 2008
Simon Mundy
<p>Gets my vote - I already use my own but would appreciate an 'official' version <ac:emoticon ac:name="smile" /></p>
Apr 06, 2008
Geoffrey Tran
<p>I do not believe that it is necessary to be extending Zend_View_Helper_Placeholder_Container_Standalone</p>
Apr 26, 2008
Xavier Vidal
<p><span style="color: rgb(51,51,51);">I propose to do a simpler implementation. Instead of passing always the array to the constructor, pass the values with a special method ('assign') and retrieve the next one using another method called 'next', 'get' or whatever you want.</span></p>
<p><span style="color: rgb(51,51,51);">The example would be like this:</span></p>
<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
<?php this->Cycle()
>assign(array('#fefefe', '#acacac')) ?><tr> <?php foreach($recordset as $row) : ?><td style="background-color:<?php echo $this>Cycle()->next() ?>"> ... bla bla ...</td><?php endforeach; ?></tr>]]></ac:plain-text-body></ac:macro>
Jul 03, 2008
Radek
<p>I agree with Xaview I think that the posibility to earn next,previous,current, first and last value can by quite handy.</p>
Jul 04, 2008
Kamil Nowakowski
<p>thanks for suggestions , i will look at this after weekend </p>
Aug 05, 2008
Matthew Weier O'Phinney
<ac:macro ac:name="note"><ac:parameter ac:name="title">Zend Comment</ac:parameter><ac:rich-text-body>
<p>This component is approved for development in standard/incubator, with the<br />
following notes/caveats:</p>
<ul>
<li>Please do not extend the base placeholder helper. We feel this would limit use cases, such as when a developer wishes to have multiple cycle objects in play at once.</li>
<li>Please add an accessor for adding cycle arguments, and make passing them to the helper optional. This will promote re-use of cycle objects within view scripts.</li>
</ul>
</ac:rich-text-body></ac:macro>
Mar 18, 2009
Wil Sinclair
<p>Has this proposal been abandoned? Please reply here.</p>
Mar 19, 2009
Kamil Nowakowski
<p>Code (class, tests and docs) is in incubator, but i have to do some changes, improvments ,I will finish it in few days </p>
Mar 20, 2009
Kamil Nowakowski
<p>Wil, I have finished the code , the helper is ready to use, (tests and docs are also in incubator)</p>
Mar 20, 2009
Wil Sinclair
<p>Great! Can you please work with MAtthew to make sure it gets promoted to trunk ASAP. I want to make sure this gets in 1.8. <ac:emoticon ac:name="smile" /></p>
<p>,Wil</p>