?
このドキュメントでは、 php中國語ネットマニュアル リリース
string fetch
(string
template [, string cache_id [, string compile_id]])
This returns the template output instead of displaying it. 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.
返回一個模板輸出的內(nèi)容(HTML代碼),而不是直接顯示出來,需要指定一個合法的模 板資源的類型和路徑。你還可以通過 第二個可選參數(shù)指定一個緩存號,相關(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 fetch().
通過第三個可選參數(shù),可以指定一個編譯號。這在你想把一個模板編譯成不同版本時使用,比如針對不同的語言編譯模板。編譯號的另外一個作用是,如果你 有多個$template_dir模板目錄,但只有一個$compile_dir編譯后存檔目錄,這時可以為每一個$template_dir模板目錄指 定一個編譯號,以避免相同的模板文件在編譯后會互相覆蓋。相對于在每一次調(diào)用display()的時候都指定編譯號,也可以通過設(shè)置$compile_id編 譯號屬性來一次性設(shè)定。
Example 13-14. fetch
|