Loading files

Template file locations are relative to a definable root directory. You can specify it directly in the constructor (first parameter, defaults to .) or via setRoot().

Files are referenced via handle names. Thus you need to specify the handle name as first parameter, and the file's name as second parameter when calling setFile(). To speed things up, you may pass an array of handle-filename pairs to the method.

Loading a template file

<?php
$t 
=& new HTML_Template_PHPLIB(dirname(__FILE__), 'keep');
$t->setFile('authors''authors.tpl');
?>
Simple example (Previous) Defining blocks (Next)
Last updated: Wed, 26 Nov 2014 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.