If you have a different variable with each template, you would have to instantiate the class for each one, i.e.:
$tmpl_header = new vlibTemplate('./templates/header.html');
$tmpl_newsheader = new vlibTemplate('./templates/news.html');
...etc.
Alternatively, you can instantiate the class into 1 variable, and have a seperate include file for each template. For example, I have a config file for each page on the site, which defines which php files to include, i.e. header.php, content.php, footer.php ...etc.
The config file will instantiate the class into $tmpl and then each included file (header.php ..etc.) starts with $tmpl->newTemplate(...blah..); and ends with $tmpl->pparse();.
If this is unclear, here's a small sample:
common.php
-----------------
?php
include '../vLIB/vlibTemplate.php';
$tmpl = new vlibTemplate;
// include header
include './includes/header.php';
// include content
include './includes/content.php';
// include footer
include './includes/footer.php';
?
and then in one of the include files you would do:
content.php
-----------------
?php
$tmpl-newTemplate'../templates/content.html';
$tmpl-setVar'some_var', 'some value';
$tmpl-pparse;
?
You see. You can do this to build up your pages.
I hope this helps.. if not then let me know.
Regards,
Kelvin