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

Follow us on Identi.ca or Twitter

Username:   Password:
Create Account | About TuxRadar