【发布时间】:2014-06-16 07:53:07
【问题描述】:
我已经安装并配置了 XAMPP。我正在尝试安装Smarty 3.1.18,但遇到了一些问题。
我已更改我的php.ini 文件以将 smarty/libs 目录添加到包含中。
我已将 smarty 解压缩到我的 c:\smarty 文件夹中
我在 htdocs 文件夹中创建了 smarty\templates 和 config 文件夹
我还在c:\smarty 文件夹中创建了我的缓存和templates_c 文件夹。
我制作了我的index.php 文件以包含所有目录,并制作了我的index.tpl 文件并将其放在我的模板文件夹中。
当我运行 index.php 文件时,我返回:
致命错误:未捕获 --> Smarty:无法加载模板文件 'index.tpl'
有什么想法吗??
我已经运行了testinstall() 脚本,这就是它返回的内容:
Smarty Installation test...
Testing template directory...
FAILED: .\templates\ does not exist.
Testing compile directory...
FAILED: .\templates_c\ does not exist.
Testing plugins directory...
C:\smarty\libs\plugins is OK.
Testing cache directory...
FAILED: .\cache\ does not exist.
Testing configs directory...
FAILED: .\configs\ does not exist.
Testing sysplugin files...
... OK
Testing plugin files...
... OK
Tests complete.
我已经检查并重新检查了我的文件位置和目录位置,这就是它们所在的位置:
$smarty->template_dir = 'c:/xampp/htdocs/smarty/templates';
$smarty->config_dir = ' c:/xampp/htdocs/smarty/config';
$smarty->cache_dir = 'c:/smarty/cache';
$smarty->compile_dir = 'c:/smarty/templates_c';
【问题讨论】:
-
请提供代码如何为 Smarty 类设置模板目录
-
好吧,无论是谁编辑了我的问题,它现在都没有意义......
标签: php smarty windows-8.1 smarty3