Logo         Community
  Trog
Services
The Company
Community
Columns
Your Account
Contact Us
 
 
Template-Based Web Development With patTemplate (part 1)
Clean up your code by using templates to separate layout from business logic.

| Looking For Alternatives |

One of the nice things about PHP - and one of the primary reasons for its popularity as a rapid application development (RAD) tool - is the fact that PHP code can be inserted into regular HTML markup to turn otherwise static HTML content into dynamic, intelligent Web pages. This feature makes it possible to quickly write PHP scripts that build Web pages on the fly from a database (or other external data source), and to create "smart" Web applications more efficiently than would otherwise be possible with traditional programming languages like Java or Perl.

However, this ease of use comes with a price: most PHP-based Web sites are a mush of intermingled HTML markup and PHP function calls, making them hard to decipher and maintain. This problem most commonly rears its ugly head when interface designers need to alter the user interface presented to Web site visitors - since the presentation information is entwined with PHP code, changes to it typically require handholding by a developer with sufficient expertise in the language. Which ultimately means more people, more time and more money...

There is, however, an alternative.

This alternative solution involves using "templates" to separate presentation and layout information from program code, and a template engine to combine the two to create the final product. This two-tiered approach affords both developers and designers a fair degree of independence when it comes to maintaining a Web site, and can substantially reduce the time and effort required in the post-release phases of a development project.

Despite these advantages, this template-based approach is not that popular - or even that well-known - amongst developers, especially those that are new to Web development. And so, over the course of this two-part article, I will be attempting to demystify how it works, in the hope that it will encourage you to use it in your next development effort.

Which is where patTemplate comes in...


How to do Everything with PHP & MySQL
How to do Everything with PHP & MySQL, the best-selling book by Melonfire, explains how to take full advantage of PHP's built-in support for MySQL and link the results of database queries to Web pages. You'll get full details on PHP programming and MySQL database development, and then you'll learn to use these two cutting-edge technologies together. Easy-to-follow sample applications include a PHP online shopping cart, a MySQL order tracking system, and a PHP/MySQL news publishing system.

Read more, or grab your copy now!


more like this print this article  next page
 
Search...
 
In trog...
Logging With PHP
Building A Quick-And-Dirty PHP/MySQL Publishing System
Output Buffering With PHP
Date/Time Processing With PHP
Creating Web Calendars With The PEAR Calendar Class
more...
 
In the hitg report...
Crime Scenes
Animal Attraction
Lord Of The Strings
more...
 
In boombox...
Patience - George Michael
Think Tank - Blur
My Private Nation - Train
more...
 
In colophon...
Hostage - Robert Crais
The Dead Heart - Douglas Kennedy
Right As Rain - George Pelecanos
more...
 
In cut!...
American Chai
The Core
Possession
more...
 
Find out how you can use this article on your own Web site!


Copyright © 1998-2017 Melonfire. All rights reserved
Terms and Conditions | Feedback