Friday, June 24, 2011

Reusing Cached elements?

Hi

In one layout I have this:

echo $this->element('some_element', array('data'=>$data, 'cache'=>'1
hour'));

This caches the element as expected (using the file system if it matters).

Now, I would like to re-use this cached element elsewhere - on another
layout.

I tried:

echo $this->element('some_element', array('cache'=>true));

expecting Cake to automatically use the cached version, but I get an error
about my $data variable missing.

I'd also like to check for the cached elements existence - and if it exists
show it; else I can regenerate it if required.

Is this possible?

Thanks.

--
View this message in context: http://cakephp.1045679.n5.nabble.com/Reusing-Cached-elements-tp4522470p4522470.html
Sent from the CakePHP mailing list archive at Nabble.com.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: