本文介绍了CodeIgniter + Smarty =错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下是我的操作:
- 下载并解压缩了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
code> test.tpl 并从控制器调用它:$ this-> Smartylib-> display('test.tpl');
- 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?
推荐答案
区分大小写:
$this->load->library('smartylib');
$this->smartylib->display('test.tpl');
这篇关于CodeIgniter + Smarty =错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!