PHPBuilder - Better alternative to FastTemplates?



RSS Twitter
Tips Html

Better alternative to FastTemplates?

by: Christopher Brown-Floyd
|
October 3, 2001

If you've been doing PHP for a while, you probably use templates to separate your HTML from your PHP code. To do this, there are a number of template processor scripts out there that you could use. So far, FastTemplate has been the leading processor. UltraTemplate, on the other hand, employs more powerful tags which makes your scripts smaller and speeds up developement time.

Here's an example HTML page using UltraTemple:

<html>
<body>
<tag:Content as="b" defaultValue="Hello UltraTemplate user!" />
</body>
</html>

...and the code to process it:

<?php
// Include UltraTemplate class
include("ultratemplate.php");

// Instanciate UltraTemplate class
objTemplate = new UltraTemplate();

// Load the template
objTemplate->load("mytemplate.tpl");

// Bind to template
objTemplate->bind();

// Display template
objTemplate->display();
?>

Using the code above, the HTML page will render as:

<html>
<body>
<b>Hello UltraTemplate user!</b>
</body>
</html>

To learn more or download UltraTemplate go to http://www.ultratemplate.com/

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Christopher Brown-Floyd

Comment:



Comment:

(Maximum characters: 1200). You have characters left.