News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
Implementing the Stage Pattern in PHP 5
April 18, 2007 @ 12:49:00

Back with another of their design patterns articles, DevShed looks this time at the Stage pattern - a flexible pattern that allows your application to adapt to requests.

At least at first glance, the definition of the "Stage" pattern seems hard to grasp, which implies that the pattern in question has to be addressed from a practical point of view. In doing so, you'll have a much better idea of how it works, and eventually how it can be applied in concrete cases. [...] Over the course of this two-part series, I'm going to introduce its key concepts, and logically show you how to implement it with copious code samples.

They start by defining a DIV class to act as a foundation for the Stage functionality (with methods to set the ID, the CSS class and the data inside it). They also develop a DivContext class to handle special methods surrounding the inputted DIV. Bringing it all together, they create a default DIV object and pass it into the custom DivContext to get and set the contents of the DIV.

0 comments voice your opinion now!
designpattern stage divcontext tutorial implement php5 designpattern stage divcontext tutorial implement php5


blog comments powered by Disqus

Similar Posts

CorePHP Blog: A Guide to running Apache 2, PHP 4 & PHP 5 on Windows XP

Zend Developer Zone: Zend_Controller_Action, Now With Parameters!

Deepak Radhakrishnan\'s Blog: Configuring Apache - PHP - MySQL on Windows (WAMP Configuration)

Jani Hartikainen's Blog: Unit testing 3: Writing tests for existing code

CodePoets.co.uk: How to use PHP and PEAR MDB2 (Tutorial)


Community Events





Don't see your event here?
Let us know!


update series language api package introduction interview tips framework laravel opinion library podcast install deployment community symfony list zendserver release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework