很简单的方法:$tpl -> set_file(array("main"=>"header.htm","index"=>"../index.php"));这样就OK了。

解决方案 »

  1.   

    这样好象不行的
    我想在index.php里面放入 head.htm和foot.htm
    而这两个文件在不同的目录下面
    指定目录,是用$tpl = new Template("tpl_1");               //*2
    来指定的~
    如果这个文件不作修改~,是实现不了目的的~
      

  2.   

    <?php
      require "inc/template.inc";                
      $tpl = new Template();              
      $tpl -> set_file(array("main"=>"tpl_1/header.htm", "foot"=>"tpl_2/foot.htm"))
      //....
      $tpl -> parse("mains","main");              //*4
      $tpl -> p("mains");                         //*5
     ?>
    你看看行不行?