First of all, thanks to manja for the explanation.
@depi : I'm fairly conviced that no model calls will be changed because of requestAction. I think I would use a direct SQL request, I dont see any drawbacks in this case. I mean, it is a very very specific case that has absolutely no effect on anything beside the view count. I don't think you'd want any specific model callbacks to be called on this action, right? On 26 mar, 09:56, depi <[email protected]> wrote: > I actually solved it with custom action and calling RequestAction from > the View, however I still don't like this solution. > > I'm updating the page views with the updateAll: > $this->Domain->updateAll(array('Domain.page_views' => > 'Domain.page_views+1'), array('Sknic.domain' => $this->params['named'] > ['idomain'])); // this is just a sample snippet > > But the problem is that it makes also 2 LEFT JOINs where 1 of them is > redundant. > I'm not sure if it is possible to use Containable behavior with > updateAll (I assume that not), so I tried to use unbindModel, but then > it unbinded it also in the site's action, which has a view with the > requestAction call (and there I need that model) > > Does anybody have any idea, how to solve this? Why when I unbind a > model from one action it gots unbinded in another too? Is it because > of the requestAction? > > On Mar 26, 1:43 pm, Jimmy Bourassa <[email protected]> wrote: > > > > > Did you end up solving your problem? If so, what did you do? > > > You made me realize the views counter we wrote in one of our app does > > not work, :( > > > I'm not a fan of the requestAction thingy, doesnt it load a full > > instance of CakePHP just for one extra request? > > > On 24 mar, 05:35, depi <[email protected]> wrote: > > > > Hi Cake bakers smile.gif > > > > I'm new to Caching and I would like to use it in my new CakePHP > > > application, however one small problem emerged during its development: > > > > I have a controller where I used for example: > > > > var $cacheAction = '5 minutes'; // so this should cache all actions of > > > that controller > > > > or > > > > var $cacheAction = array('details/' => '5 minutes'); > > > > But the problem is that in one of the controllers, I'm counting the > > > numbers of views (of a page), but when caching is enabled it can't > > > count them. > > > > // update page views > > > $this->Site->updateAll(array('Site.page_views' => 'Site.page_views > > > +1'), array('Site.id' => $id)); > > > > What is the right Cake way to disable caching for this particular > > > process? Turn on caching only for particular actions and move the > > > counting process to some private action.....I like the no-cache tags > > > for the views, it would be great if something like this would be there > > > for controllers as well smile.gif > > > > Any hints would be really appreciated. > > > > Thank you in advance.- Masquer le texte des messages précédents - > > - Afficher le texte des messages précédents - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
