I think I didn't explained myself well. Let's imagine a module with 1 action. Ok, let's add in the cache.yml that action with enabled: on Ok, now clear cache, type the url of that module/action, and it's cached now.
Ok, so, the next time we call that url, we will receive the same page, but the action is now cached! So, the code inside that action will not be executed, since it's retrieved from the cache. So, my question is... do you know some mechanism to execute ALWAYS a portion of code before or after that action? I have thought about a filter, but filter will execute with every action in the site. I just need to execute it for that only action. On Apr 24, 2:53 pm, Alexandru-Emil Lupu <[email protected]> wrote: > what do you mean "cached action" ? > if the file that contains the action is in cache folder, does not mean the > action is cached. > what is cached is the view. > if you have some issues about "CSRF" or things like that, see that it was a > topic 2-3 days ago. > about the " > > What I don't like about this is that each time it is called, it > executes 2 actions. > > Do you figure out some other better solution? > " > > i think i have an idea "function preExectute(){ /* do some foo here */ }"... > Alecs > > > > On Fri, Apr 24, 2009 at 3:29 PM, HiDDeN <[email protected]> wrote: > > > Hello. I have a little problem in Symfony. > > > The short question is: how could I update the user session inside a > > cached action? > > > And the long question is: > > > I have an action that is cached. Inside this action I have a portion > > of code that updates the user session. > > > The solution I have found is this (briefly): > > > public function executeIndex($request) > > { > > ... here I update the session > > > $this->forward('home', 'home'); > > } > > > public function executeHome($request) > > { > > ........ my code > > } > > > Using this workaround, I cache only the Home action, letting the Index > > to update the session. > > > What I don't like about this is that each time it is called, it > > executes 2 actions. > > > Do you figure out some other better solution? > > -- > I am on twitter:http://twitter.com/alecslupu > I am on linkedIn:http://www.linkedin.com/in/alecslupu --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" 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/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
