Greyledge.net
VOOT

VOOT

Vanilla Object Oriented Templates

VOOT is a simple ('vanilla') PHP class for creating web pages with templates. It supports user-defined HTTP headers, and it is capable of processing PHP contained in rendered templates.

This class was written with simplicity and flexibility in mind; templates can take the form of any text-based file, and you can define as many content placeholders as you like in each template. To indicate a placeholder in a template, you just surround a key word with percentage signs; for example, you might want to set the title of a document on the fly. The template might look like this:

<html>
  <head>
    <title>%TITLE%</title>
  </head>
...

In your PHP script, you would set the title of the above template like this:

$myVoot->setElement("TITLE", "Templates Are Fun");

There's not much else to it.

Download

Documentation

VOOT API Documentation. (Generated with PhpDocumentor.)

API Documentation is also included in the distribution.

License

VOOT is released under the GNU Public license. If you download and use VOOT, you must abide by the terms of the GPL.

Demo

This page itself is generated by VOOT, but to get a peek under the hood look at the following files: This is the demo included with the distribution. View the template file, and then view the example script and its source:

template.html
example.php
example.php source code

Why "VOOT"?

Aside from being fun to say, VOOT was my third choice after SOOT (Already taken by a Java project) and POOT. POOT is not being used by any other projects that I know of, but it's a bit scatalogical and would have gone against the recommendation of the PHP group, in that it uses the name PHP in its name rather than just describing what it is. "Vanilla" may be a bit of a stretch, but it's getting hard to come up with clever software names that haven't already been taken!

 
©2003 by Andy Chase.  Powered by VOOT