Logo         Community
The Company
Your Account
Contact Us
Injecting XML Content Into Page Templates With patXMLRenderer (part 1)
Create a modular Web site with templates, XML and Randy.

| Three Degrees Of Separation |

If you're a good Web developer, then experience has probably already taught you it's not a great idea to mix HTML markup and PHP function calls when building a PHP-based Web site. It's not wrong to do so, of course - in fact, most examples in the PHP manual adopt this approach - but from the maintenance point of view, the mix of markup and code makes scripts hard to decipher (and even harder to modify).

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.

The alternative approach (and one which most professional developers eventually gravitate to) involves using page templates to hold the presentation information and using a template engine to interpolate variable values or business logic into the templates. This separation between code and markup makes it possible for developers to modify business logic independent of the page design, and designers to alter page layouts without worrying about the effect on the code.

With the advent of XML into the enterprise, things become even more streamlined. With a little bit of thought and creativity, it now becomes possible to keep presentation information in a template, content in an XML container, and business logic in a PHP script, and use a rendering engine to combine all three into a single entity. This third layer of separation means that the content of a Web application can be updated independent of the design, which can be updated independent of the business logic...all of which significantly simplifies maintainability and ease of update.

How do you achieve this Zen-like state of simplicity and purity? With patTemplate and patXMLRenderer, of course!

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
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
In the hitg report...
Crime Scenes
Animal Attraction
Lord Of The Strings
In boombox...
Patience - George Michael
Think Tank - Blur
My Private Nation - Train
In colophon...
Hostage - Robert Crais
The Dead Heart - Douglas Kennedy
Right As Rain - George Pelecanos
In cut!...
American Chai
The Core
Find out how you can use this article on your own Web site!

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