## PHPSTART 模版引用
> 模板調用 ,返回編譯后的模版文件地址,因為是include引用編譯后的模版腳本,所以模版中可直接使用當前局部變量
@param $templatename
@param $path 默認SCRIPT_PATH
~~~
include V($template, $path)
$template 缺省值是 當前控制器名字,對應全局常量ACTION
~~~
與C() F()加載方法相同,先從$path目錄尋找模版,一直網上遍歷
如果$template以“/”開頭,則直接從程序目錄尋找模版,并不會再一層一層的往上遍歷
* * * * *
**舉例:**
http://phpstart.xyz/test/group1/index/template
~~~
function template(){
include V('helloworld');
include V('helloworld','Group2');
//include V();
}
~~~
第一個是從 '/test/group1/__Tpl/hello.html' 一直往上遍歷,最后一層是 '/test/__Tpl/hello.html'
第二個是從 '/test/group2/__Tpl/hello.html' 一直往上遍歷:
由于‘/test/group2/__Tpl/hello.html’已存在,所以直接返回編譯后的php緩存文件路徑。
第三個相當于include V('template');