代码点火器 +聪明=错误
这就是我所做的:
- 下载并解压 CI
- 下载并解压 Smarty 在
/application/libraries/Smarty-3.1.4
- 保存
https://github.com/kzhiwei/codeigniter-smarty/blob /master/application/libraries/Smartylib.php
到/application/libraries/Smartylib.php
(还修复了第 2 行以指向正确的文件夹) - 在自动加载库中添加了
Smartylib
- 创建了
test.tpl
并从控制器调用它:$this->Smartylib->display('test. tpl');
现在,我收到以下错误:
Fatal error: Call to a member function createTemplate() on a non-object in C:\wamp\www\myapp\application\libraries\Smarty-3.1.4\libs\sysplugins\smarty_internal_templatebase.php on line 47
您知道出了什么问题吗?
Here's what I did:
- Downloaded and unzipped CI
- Downloaded and unzipped Smarty in
/application/libraries/Smarty-3.1.4
- Saved
https://github.com/kzhiwei/codeigniter-smarty/blob/master/application/libraries/Smartylib.php
to/application/libraries/Smartylib.php
(also fixed line 2 to point to the correct folder) - Added
Smartylib
in autoload libraries - Created a
test.tpl
and called it from the controller:$this->Smartylib->display('test.tpl');
Now, I'm getting the following error:
Fatal error: Call to a member function createTemplate() on a non-object in C:\wamp\www\myapp\application\libraries\Smarty-3.1.4\libs\sysplugins\smarty_internal_templatebase.php on line 47
Any ideas what is wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
库引用区分大小写:
Library references are case sensitive: