这就是我的所作所为:
/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
任何想法有什么不对?
答案 0 :(得分:1)
Library references区分大小写:
$this->load->library('smartylib');
$this->smartylib->display('test.tpl');