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

SitePoint:
On Templating, Content, and Code
Sep 18, 2003 @ 12:17:08

Some people out there complain that the world doesn't need any more template engines. Others stick by their ideal that PHP is a templating engine. Well, if you've heard the debates and wondered just what template engines really are and which one might be right for you, you might want to check out this new article from SitePoint.

In Beyond The Template Engine, the author introduces you to what template engines really are, and some examples from some of the more popular ones (Ex. Smarty, of course). Template engines can provide quite a bit of flexibility for you and your site, especially if you're not the only one working on it (read "designers"). He even shows his own example of the templating class he created allowing a bit more custom templating experience in a smaller package.

And remember: the point of template engines should be to separate your business logic from your presentation logic, not to separate your PHP code from your HTML code. I'm not too sure about that one, but it's a step in the right direction...content != code != presentation.

tagged:

Link:


Trending Topics: