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_View_Helper_Cycle Component Proposal

Proposed Component Name Zend_View_Helper_Cycle
Developer Notes
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

Zend_View_Helper_Cycle is a simple component which cycles through a series of values based on an iteration number.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This helper will cycle through a series of values based on an iteration number.
  • This helper will implement Iterator interface

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




In backwards order

9. Class Skeletons



cycle cycle Delete
proposal proposal Delete
view view Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Apr 05, 2008

    <p>Gets my vote - I already use my own but would appreciate an 'official' version <ac:emoticon ac:name="smile" /></p>

  2. Apr 06, 2008

    <p>I do not believe that it is necessary to be extending Zend_View_Helper_Placeholder_Container_Standalone</p>

  3. Apr 26, 2008

    <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>  

  4. Jul 03, 2008

    <p>I agree with Xaview I think that the posibility to earn next,previous,current, first and last value can by quite handy.</p>

    1. Jul 04, 2008

      <p>thanks for suggestions , i will look at this after weekend </p>

  5. Aug 05, 2008

    <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>

    <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>

  6. Mar 18, 2009

    <p>Has this proposal been abandoned? Please reply here.</p>

  7. Mar 19, 2009

    <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>

  8. Mar 20, 2009

    <p>Wil, I have finished the code , the helper is ready to use, (tests and docs are also in incubator)</p>

  9. Mar 20, 2009

    <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>