I have been using template engines for year and years with php. I have tried a multitude of template engines and found most of them bloated especially Smarty. Seriously Smarty sucks.. one you start adding logic to your templates you have totally missed the point of having a template in the first place. If thats the route your going to go then just use php and includes for christ sakes, theres no need to invent a new programming language. Anyways I digress…
The one engine that I like the most is the template engine that shipped with phpBB 2. Its simple and does the job. Apprently the guy who wrote it copied a lot from phplib so if you are familiar with that one you should be familiar with this one. The one thing that was missing from it was the ability to cache compiled templates.
I fixed that a long time ago and never bothered to share it. You can download the class here.
A few notes…
- The constructor takes arguments for where the cache directory is and whether or not your going to use caching.
- The cache directory needs to be writable by the webserver
- Along the way I updated it to use php 5 conventions.
- Remember you can use any directory… it doesn’t have to be in the directory that gets served.
Like it? Subscribe to the blog if you haven't already
Related Posts
{TITLE}
Php Tree Class
Free Scripts
Webmaster Tools
| Filed under: Web Technologies — Scott @ January 31, 2008 11:45 am |
|










No comments yet.