課程
/后端開發
/PHP
/MVC架構模式分析與設計
smarty compile_id和compile_dir一樣不一樣呀?
2014-09-05
源自:MVC架構模式分析與設計 5-3
正在回答
不一樣,compile_dir 是設定編譯文件目錄
compile_id 是讓smarty從不同的模板目錄找出需要的模板文件來編譯
因為smarty的模板目錄改變之后,并不能讓smarty自動重新編譯模板,必須手動清理編譯緩存,才能讓smarty重新編譯。而改變了compile_id之后,就可以讓smarty重新去尋找新模板編譯。
例如
$template_path="tpl/".$bk_lang."/";$smarty=new Smarty();$smarty->compile_dir ="./smarty_c";$smarty->compile_id =$bk_lang ; $smarty->template_dir=$template_path;
舉報
通過學習MVC理論知識,由淺入深帶您實現人生第一個MVC框架
57 回答
54 回答
80 回答
48 回答
41 回答
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2014-09-05
不一樣,compile_dir 是設定編譯文件目錄
compile_id 是讓smarty從不同的模板目錄找出需要的模板文件來編譯
因為smarty的模板目錄改變之后,并不能讓smarty自動重新編譯模板,必須手動清理編譯緩存,才能讓smarty重新編譯。而改變了compile_id之后,就可以讓smarty重新去尋找新模板編譯。
例如
$template_path="tpl/".$bk_lang."/";
$smarty=new Smarty();
$smarty->compile_dir ="./smarty_c";
$smarty->compile_id =$bk_lang ;
$smarty->template_dir=$template_path;