Posts Tagged ‘design patterns’

Template View and View Helper Design Patterns in PHP (updated v2)

April 18th, 2007

The Template View and View Helper patterns lend themselves nicely when it comes to developing a View Layer solution for PHP, or so I found out with the recent refactoring of Cubix (dubbed Cubix II). This View layer duo is very much a great candidate for a “tag team”. Each component performs a role and together make up a big part of the View Layer.

update: Now includes View Helper Locator example.

» Read more: Template View and View Helper Design Patterns in PHP (updated v2)

The Singleton Pattern with PHP

May 25th, 2006

The Singleton Pattern is often mistakenly referred to as the OOP nuts “Global variable”.

Admittedly, I myself have been one of those people who had referred to it as such (this is an edited version you are reading), but in fact, the Global Variable tag that has been given to this pattern is actually a side effect – all you need to do is look at the name.

» Read more: The Singleton Pattern with PHP