Welcome Guest, Not a member yet? Register   Sign In
[Caching Driver] Problem with function get()
#1

[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;
?&gt;

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?


Messages In This Thread
[Caching Driver] Problem with function get() - by El Forum - 07-29-2012, 07:31 AM
[Caching Driver] Problem with function get() - by El Forum - 07-30-2012, 01:06 PM
[Caching Driver] Problem with function get() - by El Forum - 08-11-2012, 04:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB