4 Replies - 3459 Views - Last Post: 10 April 2011 - 09:04 AM

#1 Valek   User is offline

  • The Real Skynet
  • member icon

Reputation: 544
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

PHP Contest Series 2011 - Challenge #3

Post icon  Posted 28 February 2011 - 04:48 PM

Welcome to the third PHP challenge! This one is brought to you by yours truly ;)

The Challenge - Create a Template Engine

Upon first reading, this task may seem daunting. Do not fear, however. The requirements for this aren't for a fully featured engine, just one that works and meets a few small requirements:

  • Demonstrates clean separation of PHP and HTML when utilized.
  • Allows inclusion of dynamic data via template variables.
  • Supports template-based includes of other templates (like including headers and footers in a body template.

Once you've designed an engine that meets these requirements, draw up a small script and template (or two) and demonstrate its usage. The engine itself is worth 25 points. The demonstration of same will be 10 points.

Bonus Part (15 Points)
Build in support for template caching to speed up page loads. This includes a method for clearing one of more cache files, and optionally the ability to set the engine's cache path.

Timeframe
The deadline for this project will be April 5th, 12:00 GMT.

Requirements
  • Documentation, of course.
  • You must use OOP. Being an engine, doing this procedurally would likely lead to confusion and/or make it unnecessarily difficult, both to write and to utilize.
  • Seeing as there isn't anything in this challenge you should need one for, frameworks are disallowed.

Any questions about this challenge should be asked and will be fielded in this thread.


© PHP腕比べ遠征開発計画組

This post has been edited by Dormilich: 01 March 2011 - 12:44 PM
Reason for edit:: added team signature


Is This A Good Question/Topic? 2
  • +

Replies To: PHP Contest Series 2011 - Challenge #3

#2 Jstall   User is offline

  • Lurker
  • member icon

Reputation: 434
  • View blog
  • Posts: 1,042
  • Joined: 08-March 09

Re: PHP Contest Series 2011 - Challenge #3

Posted 01 March 2011 - 11:46 AM

Interesting,

Coincidentally I was just thinking about a way to build an OOP type templating framework. I will like to take a wack at this one... still need to start the second , stupid work keeping me away from important things :P Great challenge!
Was This Post Helpful? 0
  • +
  • -

#3 creativecoding   User is offline

  • Hash != Encryption
  • member icon


Reputation: 931
  • View blog
  • Posts: 3,216
  • Joined: 19-January 10

Re: PHP Contest Series 2011 - Challenge #3

Posted 11 March 2011 - 11:46 AM

I'm not familiar with a "template engine". Can you explain more?
Was This Post Helpful? 0
  • +
  • -

#4 Valek   User is offline

  • The Real Skynet
  • member icon

Reputation: 544
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

Re: PHP Contest Series 2011 - Challenge #3

Posted 11 March 2011 - 12:05 PM

This tutorial demonstrates a very basic kind of template engine.
Was This Post Helpful? 0
  • +
  • -

#5 sam_benne   User is offline

  • D.I.C Addict
  • member icon

Reputation: 16
  • View blog
  • Posts: 733
  • Joined: 16-January 08

Re: PHP Contest Series 2011 - Challenge #3

Posted 10 April 2011 - 09:04 AM

I wrote a template engine similar to Wordpress's for a CMS that I was working on. It is very good and allows for different templates on the same site.

Check out the front end if you want the link. If you want to know more then just contact me. P.s the whole front end is run from DB and the style is all template done.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1