刚学smarty犯了两个低级错误
刚学smarty犯了两个低级错误,记录下来, 其中一个是没有初始化smarty, "Fatal error: Call to a member function on a non-object in D:\web\works\wedding-rings.cn\index.php on line 3", smarty.php <?php require "smarty/Smarty.class.php"; define ('SiteRoot',"D:/web/works/wedding-rings.cn"); $Lang='en'; $Smarty=new Smarty(); $Smarty->template_dir = SiteRoot ."/templates//"; $Smarty->compile_dir = SiteRoot ."/templates_c//"; $Smarty->config_dir = SiteRoot ."/configs/"; $Smarty->cache_dir = SiteRoot ."/cache/"; $Smarty->left_delimiter = '<{'; $Smarty->right_delimiter = '}>'; ?> index.php(注意红色字体,小写了) <?php require "smarty.php"; $s marty->assign('Title',"测试页面"); $s marty->display("index.htm"); ?> "Fatal error: Smarty error: [in index.htm line 8]: syntax error: unrecognized tag 'Title' (Smarty_Compiler.class.php, line 590) in D:\web\works\wedding-rings.cn\smarty\Smarty.class.php on line 1095", 这个便是我按照phplib模版的写法导致的错误 模版中写成这样 <刚学smarty犯了两个低级错误> 实际上应该这样 <{$ Title}>
上一主题: div不能嵌套li一例 下一主题: 让APACHE支持.htaccess
查找相关文章:smarty smarty fatal error
一 二 三 四 五 六 日 1
2 3
4
5
6
7
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Copyright ©2005 - 2007 老李的个人日志. All Rights Reserved
本日志程式及模版由老李(QQ:8989215)编写维护
粤ICP备06043306号