On Sat, Aug 7, 2010 at 2:01 PM, andy <[email protected]> wrote: > Hi all, > > Has anyone made a CakePHP project where you have a homepage that pulls > information from various models (ex: calendar events, news articles, > etc.) and displays it on said homepage? > > In Rails I did something like that in the past... and I was able to > clear the cache for the homepage whenever I made an update to any of > the (calendar events, news articles, etc.) models. > > I've been reading through the CakePHP Book docs and searching this > group but I haven't been able to find a way to clear my Homepage cache > whenever I make a change to those "included" models. > > Any idea how I could do this? If all else fails... I may just have to > put in some code to delete the main Homepage cache file manually after > a model is saved or deleted. But I still hope there is a cleaner > way...
Use the clearCache() function. http://book.cakephp.org/view/348/Clearing-the-Cache if ($this->Whatever->save($this->data)) { clearCache('...'); You can either remove the cached home page or don't cache the entire page and delete just the appropriate element. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
