2011-10-02 104 views
3

我已創建的文件夾結構,用於Smarty模板包括使用相對路徑從子文件夾Smarty模板

 
f 
.f1 
..template1.tpl 
..test.tpl 
template1.tpl 

的template_dir模板路徑指向文件夾「F /」

在test.tpl

是以下代碼

{include file="template1.tpl"} 
{include file="../template1.tpl"} 

此代碼無效。任何想法,我可能會出錯?

我閱讀了關於$ smarty-> use_sub_dirs = true的文檔,該文檔確實在我的template_c文件夾中創建了子文件夾,但仍無法按照上述代碼包含模板。

在此先感謝。

+3

。這個想法是做一個{include file =「f1/template1.tpl」} {include file =「template1.tpl」} – ravin

回答

3

只需添加F1到您的網址

{包括文件= 「F1/template1.tpl」}我能解決這個自己