To dynamically add new functionality to class instances.
- Zend Framework: decorators for
Zend_Form_Element
instances - Web Service Layer: Decorators JSON and XML for a REST service (in this case, only one of these should be allowed of course)
You can also find these code on GitHub
RendererInterface.php
RendererInterface.php
Webservice.php
Webservice.php
Decorator.php
Decorator.php
RenderInXml.php
RenderInXml.php
RenderInJson.php
RenderInJson.php
Tests/DecoratorTest.php
Tests/DecoratorTest.php