SimpleTemplate

Thomas Hurst

freaky@aagh.net

SimpleTemplate is a fast templating engine for PHP similar to PEAR's Integrated Templates


Table of Contents
Introduction
Template Syntax
SimpleTemplate API

Introduction

What are templates?

The purpose of a templating system is to ease the seperation of presentation from content, which can improve readability, maintainability, extend human lifespan by 400% and bring about world peace.

There are lots of methods of doing this - XML/XSL, Smarty, FastTemplates, etc. SimpleTemplate is yet another one.

Features

  • Nested blocks - rather than leave it up to you to make your PHP work out how everything fits together, the template system does most of the work for you.

  • Variable modifiers - SimpleTemplate can apply several filters to variables before entering them into the output, adding a further layer by which to help abstract output format from your PHP code.

  • Fast - it doesn't just use a simple str_replace() loop, but splits the template down to a more suitable internal format.