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

Proposed Component Name Zend_Text_Tree
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Text_Tree
Proposers Benjamin Eberlei
Zend Liaison TBD
Revision 1.0 - 6th November 2009 (wiki revision: 3)

Table of Contents

1. Overview

This component takes either an Array or a RecursiveIterator whose elements implement __toString() and
prints a tree in ascii art exactly like the unix command tree does with directory structures.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component MUST render a tree in Ascii chars.

4. Dependencies on Other Framework Components

None

5. Theory of Operation

You would create a tree object:

Which would look for example like the output generated
by the new Config Provider for Zend Tool (due in 1.10)

Or you use a Recursive Iterator for example:

The most basic code is already contained in Zend_Tool_Framework_System_Provider_Config, this proposal should
find out in what way this API should be extracted into its own class.

6. Milestones / Tasks

  • Milestone 1: Community Review
  • Milestone 2: Zend Review
  • Milestone 3: Extraction/Refactoring/Testing & Documentation

7. Class Index

  • Zend_Text_Tree
  • Zend_Text_Tree_InvalidDataException
  • Zend_Text_Tree_InvalidItemException

8. Use Cases

9. Class Skeletons

]]></ac:plain-text-body></ac:macro>

]]></ac:plain-text-body></ac:macro>

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Nov 05, 2009

    <p>"This component takes either an Array or a RecursiveIterator whose elements implement __toString()"</p>

    <p>I assume the array can also just contain a lot of strings, rather than elements implementing __toString()?</p>

    <p>Aside from that, will there be any html-specific stuff be implemented? Maybe a decorator-like system? (hint: make it as flexible as Zend_Form's and everybody will love it! <ac:emoticon ac:name="laugh" />) </p>

    1. Nov 06, 2009

      <p>yes, strings are of course perfectly fine as leaves of the tree.</p>

      <p>we should of course make a whole tree proposal out of it and rendering the text tree only a part of it, like ezcTree for example, however the code is already mostly finished and hidden deep inside Zend_Tool by me (easter egg time), i just want to make this public to everyone to use. There are several use-cases in Zend Tool that require this behaviour.</p>

      <p>Though technically Zend Tool because of its support for multiple clients requires a bigger proposal, allowing to render those trees in other enviroments too. However this proposal is just about the Text Tree rendering. A future extension might solve the gap and integrate that into a bigger picture.</p>

  2. Dec 01, 2009

    <p>I saw that this component MUST render in ascii, but... is it possible to create adapters to output? I think this can make possible to create a view_helper in the future. For this moment we can implement a text plain adapter and we can use this by default</p>

    <p>if the idea about adapters is good for you, the adapter_abstract class could implement some "triggers" also</p>

    1. Jul 28, 2010

      <p>What other ways of output did you have in mind?</p>

  3. Feb 08, 2011

    <p>Archiving this proposal, feel free to recover it when you want to work on it again. For more details see <a href="http://framework.zend.com/wiki/display/ZFDEV/Archiving+of+abandoned+proposals+(Feb+5+2011)">this email</a>.</p>