smarty 預設安裝

網路與網站相關議題和知識
回覆文章
dtchang
Site Admin
文章: 84
註冊時間: 2017-01-22, 16:54

smarty 預設安裝

文章 dtchang » 2018-05-07, 10:58

安裝目錄
D:/Inetput/smarty
/libs
/templates
/templates_c
/cache
/configs
後四個目錄可讀寫,供smarty使用
可以不用額外設定;也可以依 project 額外設定運行目錄
$smarty->setTemplateDir(APP_PATH . "/templates/");
$smarty->setCompileDir(APP_PATH . "/templates_c/");
$smarty->setCacheDir(APP_PATH . "/cache/");
$smarty->setConfigDir(APP_PATH . "/configs/");

在 php.ini 中修改
include_path
加入 如
include_path = ".;C:/php-5.6.6/includes;D:/inetpub/smarty"
這樣可以方便載入 smarty 設定檔,
直接用
require('libs/Smarty.class.php');
省得設定路徑的問題

回覆文章