StackOverflowNewbie
StackOverflowNewbie

Reputation: 40633

CodeIgniter + Smarty = Error

Here's what I did:

  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?

Upvotes: 0

Views: 838

Answers (1)

Wayne
Wayne

Reputation: 1290

Library references are case sensitive:

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

Upvotes: 1

Related Questions