?
本文檔使用 php中文網(wǎng)手冊(cè) 發(fā)布
void display
(string
template [, string cache_id [, string compile_id]])
This displays the template. Supply a valid template resource type and path. As
an optional second parameter, you can pass a cache id. See the caching section for more information.
顯示模板,需要指定一個(gè)合法的模板資源的類型和路徑。你還可以通過(guò)
第二個(gè)可選參數(shù)指定一個(gè)緩存號(hào),相關(guān)的信息可以查看緩存。
As an optional third parameter, you can pass a compile id. This is
in the event that you want to compile different versions of the same
template, such as having separate templates compiled for different
languages. Another use for compile_id is when you use more than one
$template_dir but only one $compile_dir. Set a separate compile_id for
each $template_dir, otherwise templates of the same name will overwrite
each other. You can also set the $compile_id
variable once instead of passing this to each call to display().
通過(guò)第三個(gè)可選參數(shù),可以指定一個(gè)編譯號(hào)。這在你想把一個(gè)模板編譯成不同版本時(shí)使用,比如針對(duì)不同的語(yǔ)言編譯模板。編譯號(hào)的另外一個(gè)作用是,如果你
有多個(gè)$template_dir模板目錄,但只有一個(gè)$compile_dir編譯后存檔目錄,這時(shí)可以為每一個(gè)$template_dir模板目錄指
定一個(gè)編譯號(hào),以避免相同的模板文件在編譯后會(huì)互相覆蓋。相對(duì)于在每一次調(diào)用display()的時(shí)候都指定編譯號(hào),也可以通過(guò)設(shè)置$compile_id編譯號(hào)屬性來(lái)一次性設(shè)定。
Example 13-12. display
|
Use the syntax for template
resources to display files outside of the $template_dir directory.
通過(guò)模板資源的語(yǔ)法來(lái)使用不在$template_dir模板目錄
下的文件。
Example 13-13. function display template resource examples
|