This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

[SOLVED] getViewCacheManager non-object error

Discussion specific to symfony 1.1.x stable

[SOLVED] getViewCacheManager non-object error

by pieter333 » Sun Aug 10, 2008 11:23 pm

Hi,

I want to put some stuff into the cache inside an action.

I tried:

Code: Select all
$cacheManager = sfContext::getInstance()->getViewCacheManager();
$cacheManager->set('something');


or

Code: Select all
$this->getContext()->getViewCacheManager()->set('something');


But with both situations I get "Fatal error: Call to a member function set() on a non-object in ...." :x

If I read the documentation I guess the above code is correct, or can somebody tell me what I do wrong?

Thnx!!

Pieter
pieter333
Member
 
Posts: 56
Joined: Wed Aug 15, 2007 6:04 pm
Location: Netherlands

Re: getViewCacheManager non-object error

by pieter333 » Mon Aug 11, 2008 10:43 am

Anyone?
pieter333
Member
 
Posts: 56
Joined: Wed Aug 15, 2007 6:04 pm
Location: Netherlands

Re: getViewCacheManager non-object error

by pieter333 » Wed Aug 13, 2008 10:05 am

?
pieter333
Member
 
Posts: 56
Joined: Wed Aug 15, 2007 6:04 pm
Location: Netherlands

Re: getViewCacheManager non-object error

by pieter333 » Mon Aug 18, 2008 2:17 pm

Nevermind, I know the problem now, I forgot to turn on caching in the development environment.
pieter333
Member
 
Posts: 56
Joined: Wed Aug 15, 2007 6:04 pm
Location: Netherlands

Re: [SOLVED] getViewCacheManager non-object error

by pedrocasado » Sun Mar 10, 2013 8:47 pm

thanks!
pedrocasado
Junior Member
 
Posts: 9
Joined: Sat Dec 11, 2010 12:18 am