【问题标题】:CodeIgniter + Smarty = ErrorCodeIgniter + Smarty = 错误
【发布时间】:2011-10-25 00:02:28
【问题描述】:

这就是我所做的:

  1. 已下载并解压缩 CI
  2. /application/libraries/Smarty-3.1.4中下载并解压Smarty
  3. 已将 https://github.com/kzhiwei/codeigniter-smarty/blob/master/application/libraries/Smartylib.php 保存到 /application/libraries/Smartylib.php(也将第 2 行固定为指向正确的文件夹)
  4. 在自动加载库中添加了Smartylib
  5. 创建了一个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

有什么想法吗?

【问题讨论】:

    标签: php codeigniter smarty codeigniter-2


    【解决方案1】:

    Library references 区分大小写:

    $this->load->library('smartylib');
    $this->smartylib->display('test.tpl');
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-22
    • 2020-12-04
    • 1970-01-01
    • 2013-10-19
    • 1970-01-01
    • 1970-01-01
    • 2016-02-29
    • 1970-01-01
    相关资源
    最近更新 更多