Helping ordinary people create extraordinary websites!

Template Driven PHP Architecture

By Inforlinx
2004-06-23

A case study
Managing a newspaper site.
Consider an ideal scenario where the application developer and designer have clearly demarcated portfolios.

For example, let's say you are creating a web page that is displaying a newspaper article. The article headline, tagline, author and body are content elements, they contain no information about how they will be presented. They are passed into the Template engine by the application, and then the template designer edits the templates and uses a combination of HTML tags and template tags to format the presentation of these elements (HTML tables, background colors, font sizes, style sheets, etc.)

One day the programmer needs to change the way the article content is retrieved (a change in application logic.) This change does not affect the template designer; the content will still arrive in the template exactly the same. Likewise, if the template designer wants to completely redesign the templates, this requires no changes to the application logic. Therefore, the programmer can make changes to the application logic without the need to restructure templates, and the template designer can make changes to templates without breaking application logic.

Method
To use a mechanism that enables the coders/designers to include functionality, which is defined elsewhere. This method allows cutting down the drudgery of re-iterating already existing functionality. This has eventually lead to the concept of TEMPLATES.



Tutorial pages:
 1 Votes

You might also want to check these out:


Leave a Comment on "Template Driven PHP Architecture"
You must be logged in to post a comment.

Link to This Tutorial Page!


GET OUR NEWSLETTERS