Thank you for your reply. I already found some solutions to do these things without requestAction() in my views and think the code is cleaner now :).
I was using it to get news on the frontpage, listing of leagues for menu, etc. Since I have more than one layout and each layout needs other variables, all these variables would be useless. I moved this to beforeRender, now it sets variables for appropriate layout. I also had been using them for checking if the logged user has some role (/users/isEditor, etc.), I moved this to $loggedUser in view, so now I'm calling my my user box helper with $loggedUser variable. Is it standard behavior of requireAction() that when it is used in view or helper, it causes problems with flash? In other words, can I normally use requireAction() in views? Because I'd like sometimes to use it, it just worked except for the flash error. Again, please excuse my English and please write in more basic English, I think I still haven't completely get your first paragraph :o) On Jul 21, 4:26 pm, Grant Cox <[EMAIL PROTECTED]> wrote: > It's "requestAction", and the only thing you can do is ensure that the > appropriate data is loaded in the controller for each request - so > that the view isn't missing anything. > > Generally this means moving functionality out of your controllers, and > into somewhere that is more generally accessible - such as in Models, > or Components. > > Post an example of a requestAction you are currently using, and we'll > give feedback on how this should be refactored. > > On Jul 22, 1:23 am, angel333 <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > I just found that my problem with setFlash > > -http://groups.google.com/group/cake-php/browse_thread/thread/2fcc3e3c... > > - caused requireAction() in my layout and helpers. Is there any good > > equivalent of this method? > > > Please excuse my English :o) > > > Thanks, > > Ondrej Simek --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
