Skip to content

Latest commit

 

History

History
 
 

Composite

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Purpose

To treat a group of objects the same way as a single instance of the object.

Examples

  • a form class instance handles all its form elements like a single instance of the form, when render() is called, it subsequently runs through all its child elements and calls render() on them
  • Zend_Config: a tree of configuration options, each one is a Zend_Config object itself

UML Diagram

Alt Composite UML Diagram

Code

You can also find this code on GitHub

RenderableInterface.php

RenderableInterface.php

Form.php

Form.php

InputElement.php

InputElement.php

TextElement.php

TextElement.php

Test

Tests/CompositeTest.php

Tests/CompositeTest.php