PHP: View Object Collections and the Composite View Design

In this second part of a series, I demonstrate how to create a concrete composite view class, capable of rendering single and multiple view templates via the same “render()” method. The definition of this brand new class not only shows the logic that drives the Composite View pattern, but reveals how the pattern takes advantage of the benefits offered by Composition.
- As its name suggests, the Composite View design pattern is a subtle variation of the “standard” Composite, which permits you to manipulate indiscriminately a single view object and a collection of them through the same interface. As with many other popular patterns, the implementation of Composite V...

Read Full Article