Templates
The original idea behind templating is fairly simple - if you abstract the code that displays content from the content itself, the end result is a cleaner, more simple site. This was the same thinking behind Cascading Style Sheets (CSS), in that CSS enabled you to take all the formatting and layout code embedded inside your HTML and place it into a separate file.
PHP itself was, in a way, just a template system at the very beginning of its life; its main purpose was to allow you create various types of content (guestbooks and other such web regulars) using special keywords and a limited command set.
Now that PHP is a full language in its own right, things have gone full circle - you can now create a template system in the language that used to be just a template system itself!
Next chapter: Templates ABC >>
Previous chapter: Calculating similarity of words
Jump to:
Home: Table of Contents



Copyright 2012 Future Publishing Limited (company
registered number 2008885), a company registered
in England and Wales whose registered office is at
Beauford Court, 30 Monmouth Street, Bath, BA1 2BW, UK