Display Tutorials

  Home arrow Display Tutorials arrow Writing a Template System in PHP

Writing a Template System in PHP
By: bluephoenix
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 69

    Table of Contents:
  • Writing a Template System in PHP
  • The Implementation
  • The Template File
  • The Class Skeleton
  • Constructor and Output
  • Replacing Tags
  • Including Dynamic Files
  • The Final Code
  • Tricks



    Writing a Template System in PHP

    (Page 1 of 9 )

    Learn how to use templates in your web applications and implement them with object oriented code.

    Templating is an easy way to create large sites without much hassle in maintaining a consistent look and feel across them. A standalone template file contains the HTML framework of the page and placeholders. A script can take the template file and replace the placeholders with the appropriate content to produce the final page.

    While I was working on a recent project I came across the need for a basic templating script. There are several templating systems available; some are native to PHP while others have been ported to PHP from other programming languages. But, I found existing packages were too cumbersome for my needs.

    The project needed something small and simple but also extensible. I needed something easy to implement and required little programming knowledge to be used successfully. For those reasons I decided to script my own templating engine.

    More Display Tutorials Articles
    More By bluephoenix

    blog comments powered by Disqus


    - Smart Auto Refresh
    - Writing a Template System in PHP

    Developer Shed Affiliates


    © 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap