日期:2014-05-17  浏览次数:20466 次

Smarty模板路径配置问题(急)
昨天装上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 下默认路径符为 \ 同时支持 /