Subscribe:

January 31, 2008

Improved PHP Template class from phpBB

Filed under: Web Technologies — Scott @ 11:45 am

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.

Popularity: 99% [?]


Like it? Subscribe to the blog if you haven't already
Digg!

Related Posts


RSS feed | Trackback URI

2 Comments »
Comment by TonyB
2009-04-01 19:43:23

Hi Everyone,
I have a carpet cleaning business in Houston,TX that was doing pretty good until the economy went bad, and with it my clientele. I have a website for the business but I dont
know what I have to do the get it to show up in a search. Right now it’s somewhere in the yahoo/google netherworld (LOL).

Is there someone on here that can give me some insight or know of anyone that coud give me insight on how I can get my local website on the front
page of a Yahoo or Google search to increase my business without it costing me 5 or 10k $$$? If so please share with me.

I thank you and my hungry over-eating children thank you.

thanks,

 
Comment by Maria
2010-11-15 07:24:11

Hi Tony,

You need to promote your website via different platforms such as article, press release and social media promotion.

For article, you can use eziearticles as the best option and for Press release, use 1888PressRelease as an option. Both offer free service with 1888PressRelease also offer economical plan which you can use to create brand of your press release and get better traffic.

 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.