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

DevShed:
Building a Template Parser (Part 1)
Mar 23, 2005 @ 13:10:56

With all of the template systems out there for PHP these days, it may seem like none of them are exactly what you're looking for. If that's the case, you might want to consider working up a custom set of classes to parse your own templates, and this new article from DevShed can help you get started.

It is easy to create a templating system in PHP; in fact, there are a number of templating system packages. But what if you're putting together a relatively small website, and don't really need one of those full-fledged systems? In this first part of a two-part article, you will learn how to create a simple but extensible PHP class for parsing templates.

I am glad, however, that they pointed out the fact that PHP itself is a templating system - one that's very extensible, but still, at some base level, useful for templating your sites. From there, they go on to show you how to start the class structure, create the parseFile and display methods, and how to tie it all together into a useable system.

tagged:

Link:


Trending Topics: