mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-13 03:16:21 +02:00
README for Composite
This commit is contained in:
@ -3,18 +3,8 @@
|
|||||||
namespace DesignPatterns\Composite;
|
namespace DesignPatterns\Composite;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Composite pattern
|
|
||||||
*
|
|
||||||
* Purpose:
|
|
||||||
* to treat a group of objects the same way as a single instance of the object
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
* - a form class instance handles all its form elements like a single instance of the form, when render() is called, it
|
|
||||||
* subsequently runs trough all its child elements and calls render() on them
|
|
||||||
* - Zend_Config: a tree of configuration options, each one is a Zend_Config object
|
|
||||||
*
|
|
||||||
* The composite node MUST extend the component contract. This is mandatory for building
|
* The composite node MUST extend the component contract. This is mandatory for building
|
||||||
* a tree of component.
|
* a tree of components.
|
||||||
*/
|
*/
|
||||||
class Form extends FormElement
|
class Form extends FormElement
|
||||||
{
|
{
|
||||||
|
12
Composite/README.md
Normal file
12
Composite/README.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Composite
|
||||||
|
|
||||||
|
# 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 trough all its child elements and calls `render()` on them
|
||||||
|
* `Zend_Config`: a tree of configuration options, each one is a `Zend_Config` object itself
|
||||||
|
|
Reference in New Issue
Block a user