Main Page | Class List | Directories | File List | Class Members | File Members | Related Pages

Templification

Introduction

So... you have a need for templates, but you want something VERY simple and easy to drop into place in any project. That's where Templification comes in! It will take any HTML file with special tags (defined later) and turn it into a working PHP file, which you need only include() any time you want to output the contents.

Author:
Jason Schmidt

Pros and Cons

Advantages of this method

Disadvantages:

Description

This file understands only a few operations:

The tags which correspond to the above operations are as follows:

 // PRINT_EXPRESSION
 // This is a PHP expression which will RETURN text to be included
 // in the template.  This will be dereferenced to:
 <?php print( ... ); ?>

 // INCLUDE_EXPRESSION
 // This is a PHP expression which will RETURN a string containing a
 // file name to be included.  This will be dereferenced to:
 <?php include( ... ); ?>

 // FOREACH_EXPRESSION
 // This MUST be a foreach expression from PHP.  A foreach
 // expression is anything in the format "array as variable".  It
 // will be dereferenced to:
 <?php foreach( ... ) { ?> ... <?php } ?>

 // IF_EXPRESSION
 // This must be a PHP expression that you would expect to find
 // inside an if() statement.  It will be dereferenced to:
 <?php if( ... ) { ?> ... <?php } elseif ( ... ) { ?> ...
 <?php } else { ?> ... <?php } ?>

<html>
	<body>
		{| "Hello " |}
		{@ preg_split("//", "world.") as $letter @}
			{? "." == $letter ?}
				!
			{! " " == $letter !}
			{!}
				{| $letter |}
			{?}
		{@}
	</body>
</html>

Note:
This project has opted out of accepting donations as there are currently no fees involved in its devolpment. If you wish to donate, please do so to the author: Jason Schmidt. If you are interested in paying for support time or dedicated development, please contact Jason directly.

Change Log

Version:
2.1.1
Version:
1.1.1



Generously hosted by   SourceForge.net Logo
Generated on Sat May 14 05:49:25 2005 for Templification by   Doxygen 1.4.1