![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
相关问题
下载了smarty把libs目录放到了根目录下的smarty目录下,分别建立了cache configs templates 和templates_c目录,建立了一个config.php的文档,内容如下,然后把templates目录移到了根目录下.
CODE: <?php include "./libs/Smarty.class.php"; @define('__SITE_ROOT', '.'); $tpl = new Smarty(); $tpl->template_dir = __SITE_ROOT . "./templates/default/"; $tpl->compile_dir = __SITE_ROOT . "/templates_c/"; $tpl->config_dir = __SITE_ROOT . "/configs/"; $tpl->cache_dir = __SITE_ROOT . "/cache/"; $tpl->left_delimiter = '<{'; $tpl->right_delimiter = '}>'; ?> |
所遇到的问题是,在smarty目录里建立smarty.php测试文件可以显示,内容如下
CODE: <?php include "config.php"; $tpl->assign("content", "这是内容"); $tpl->display('index.html'); ?> |
而在根目录下建立smarty.php测试文件却显示不出来,内容如下,不知道是什么原因造成的.
CODE: <?php include "smarty/config.php"; $tpl->assign("content", "这是内容"); $tpl->display('index.html'); ?> |
提问者:something 08-22 12:12
答复

