Tuesday, June 28, 2011

Callback afterSave

I have a model with afterSave() function that deletes the saved cache data.

afterSave() {

Cache::delete( 'basic_list', 'inmemory');
}

Now controller has 2 functions that save data, one is a form is submitted
save data, delete cache return updated data,

Other is a simple saveField to save a single field (ajax).

Problem is the afterSave function deletes the cache when the form is
submitted but nothing happens when just the single field gets saved.

I tried using save() instead of the savefField() but still nothing.

Even tested with afterSave() {
Echo 'hey';
}

And in both cases hey is echo'd but then if I test the cache delete it still
only works for the full form.

--
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: