i've made a slight modification to template.inc to allow for multiple templates to be included in one template file. this saves some I/O load time of multiple templates by putting the most common ones in one main template file. any one interested? you get a slight speed increase -- not much though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
may I ask for help with template? I tried example from doc and it works. Then I started to create my own template. My temp.ihtml consist of:
<html><header>...{TITLE}...</header><body>....{OUT}...</body></header>
and resides in dir /var/www. My script follows doc:
i've made a slight modification to template.inc to allow for multiple templates to be included in one template file. this saves some I/O load time of multiple templates by putting the most common ones in one main template file. any one interested? you get a slight speed increase -- not much though.
Hi,
may I ask for help with template? I tried example from doc and it works. Then I started to create my own template. My temp.ihtml consist of:
<html><header>...{TITLE}...</header><body>....{OUT}...</body></header>
and resides in dir /var/www. My script follows doc:
<?php
include("./template.inc");
$t = new Template("/var/www", "keep");
$t->set_file(array(
"page" => "temp.ihtml"));
$t->set_var(array("TITLE" => "Testpage",
"OUT" => "hugo"));
$t->p("page");
?>
But this script produces only <html><body></body></html>.
Can you, please, tell me what is wrong?
you need to execute the $t->parse() method before $t->p().