CodeIgniter + Smarty =错误 [英] CodeIgniter + Smarty = Error

查看:108
本文介绍了CodeIgniter + Smarty =错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的操作:


  1. 下载并解压缩了CI

  2. 下载并解压缩Smarty /application/libraries/Smarty-3.1.4

  3. 已储存 https://github.com/kzhiwei /codeigniter-smarty/blob/master/application/libraries/Smartylib.php /application/libraries/Smartylib.php (也是固定线路2

  4. 在自动加载库中添加了 Smartylib code> test.tpl 并从控制器调用它: $ this-> Smartylib-> display('test.tpl');

  1. Downloaded and unzipped CI
  2. Downloaded and unzipped Smarty in /application/libraries/Smarty-3.1.4
  3. 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)
  4. Added Smartylib in autoload libraries
  5. 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 =错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆