[eluser]Komeniusz[/eluser]
Hi everyone!
I have a problem with Caching Driver in CI 2.1.2.
When I try to run this code in my view file:
Code:
<?php
$this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));
if ( ! $foo = $this->cache->get('foo'))
{
echo 'Saving to the cache!<br />';
$foo = 'foobarbaz!';
// Save into the cache for 5 minutes
$this->cache->save('foo', $foo, 300);
}
echo $foo;
?>
I get thouse error messages:
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$cache
Filename: views/index.php
Line Number: 21
Fatal error: Call to a member function get() on a non-object in /home/komeniusz/public_html/sejny/application/views/index.php on line 21
What's wrong?