News Feed
Sections




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

PHPMaster.com:
Patterns for Flexible View Handling, Part 1 - Working with Composites
August 30, 2012 @ 08:32:36

PHPMaster.com has started up a new series today with the first part of a set of tutorials looking at design patterns that can be used in the handling of your views to make them more effective and easier to maintain.

To overcome your skepticism [of an easy to use, flexible view system], in this two-part tutorial I'll show you how to implement from scratch a couple of customizable view handling modules by sinking our teeth into the goodies of the Composite and Decorator patterns.

He starts off by creating a foundation to work from - a basic View class that takes in data, allows for the setting of a template and combines it all together when "render()" is called. He then takes this example and applies the Composite pattern and creates interfaces for the template, container and view, implements them and shows how to attach views to other views. Each of these views is then rendered when the main "render()" method is called and the output is appended.

0 comments voice your opinion now!
view handling mvc composite designpattern tutorial


blog comments powered by Disqus

Similar Posts

PHPit.net: PHP on the command line

Rob Allen's Blog: On models in a Zend Framework application

DevShed: Parsing Web Document Nodes with the Tidy Library in PHP 5

PHP-Coding-Practices.com: How I Turned A Slow Array Sort Into A Quick One Using Quicksort Algorithm

Ivan Iordanov's Blog: extending Zend_Db_Table to create NestedSet models


Community Events





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


version composer voicesoftheelephpant symfony api threedevsandamaybe configure unittest opinion interview language release framework introduction podcast series list conference community laravel

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