Search code examples
phpcakephpcachingcache-controlcakephp-2.1

Clearing element cache in CakePHP


I echo one element from my ctp file like this:

 echo $this->element('myelement',
                array( "name" => $name) ,
                array( "cache" => "false")
            );

Elements is shown successfully. But it seems like the same element is shown. It doesn't change after a refresh.

I couldn't clear element cache. I tried

  • Cache::clear();
  • clearCache();

but didn't work.

My debug level is default: 2

Should i check any other thing? Thank you


Solution

  • http://book.cakephp.org/2.0/en/views.html#passing-variables-into-an-element

    thats probably because "false" can be interpreted as TRUE - you need to actually pass a false value:

    "cache" => false
    

    without ".