Menu

modified template support multiple templates

mocha
2001-10-02
2001-11-06
  • mocha

    mocha - 2001-10-02

    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.

     
    • Vladimir Naprstek

      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?

       
    • mocha

      mocha - 2001-11-06

      you need to execute the $t->parse() method before $t->p().

       

Log in to post a comment.