News Feed
Sections




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

DevShed:
Using Recursive Methods in Object-based PHP Applications (Part 2)
May 09, 2006 @ 06:25:54

DevShed has posted part two of their series dealing with recusion in PHP, this time with a focus on its use in a more object-oriented environment.

Welcome to the second tutorial of the series "Recursion in PHP." Comprised of three parts, this series introduces the fundamentals of recursion in PHP, including the definition and use of recursive functions in procedural PHP scripts, as well as the creation of recursive methods in object-oriented Web applications.

Now, in this second part of the series, I'll explore some advanced uses of recursion in PHP, particularly in the terrain of object-oriented programming. I will develop a couple of object-based applications which use recursive methods for accomplishing their tasks. By the end of this tutorial, you should have a pretty solid grounding in how to define recursive methods within your own PHP classes.

They start with a simple example of OOP with recursion, handling some "HTML widgets" to be output to a page (div, h1, p, and ul tags). With this library created and in place, they work up a "generator" class to actually build the page dynamically. Finally, they bring it all together with the creation of a simple template processor for simple page creation.

0 comments voice your opinion now!
recursion object-oriented tutorial part2 template html recursion object-oriented tutorial part2 template html


blog comments powered by Disqus

Similar Posts

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 11)

Greg Freeman: Processing data with PHP using STDIN and Piping

Master Zend Framework: Howto Handle External Form Element Dependencies with FormElementManager

Padraic Brady's Blog: Writing A Simple Twitter Client Using the PHP Zend Framework's OAuth Library

Version Control Blog: Upgrading Drupal with Git


Community Events

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


library introduction framework series voicesoftheelephpant xdebug podcast symfony2 php7 opinion extension performance community version example release conference interview api laravel

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