Home arrow PHP arrow Page 2 - PHPLib Templates

Simplify - PHP

PHPLIB templates can grant you an amazing ability to abstract the manipulation of data (in the database as well as in PHP) from its final format, whether that format is HTML, XML, WML, or a formatted e-mail, and some of these ways will be explored here.

TABLE OF CONTENTS:
  1. PHPLib Templates
  2. Simplify
  3. Home is where the heart is
  4. Let's get started
  5. Dealing with blocks
  6. Nested blocks...
  7. Aren't we done YET?
  8. Closing
By: Benjamin D. Smith
Rating: starstarstarstarstar / 21
February 28, 2001

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
Templates need not be complex. For an example of a simple template, click here. This is a file that can be turned into a template with the greatest of ease - code like the following would easily support this:

<? $time='time'; $people='men'; $nation='country'; include template01.txt; ?>

This is a template - it allows you to keep your code in one file and the output in another, and allows you to change the template without having to alter (much of) your PHP coding.

This is a most simple example, and only allows you to decouple really basic parts - which is why I bring up the powerful, flexible, and fast PHPLIB template class.

It's more complicated than the above example for simple variables - but when you get into the more advanced features, you'll quickly find that the additional complexity is a very small price compared to the benefits gained.



 
 
>>> More PHP Articles          >>> More By Benjamin D. Smith
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


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

Dev Shed Tutorial Topics: