昨天装上smarty,可是在配置模板的路径时遇到问题。
define(root, str_replace(\\, /, dirname(__file__)).'/');
require 'libs/smarty.class.php';
$smarty= new smarty();
$smarty->settemplatedir(root.'templates/');
print_r($smarty->gettemplatedir());
运行输出的模板路径如下:
f:/php program/smarty/templates\
也就是最后的那个路径分隔符怎么也调不对,在、一直没调好,怎么办?
smarty php 分享到:
------解决方案--------------------
不需要改!
linux 下路径符为 /
window 下默认路径符为 \ 同时支持 /
