On Mon, Jan 19, 2009 at 2:54 AM, Michael <[email protected]> wrote: > > Hi, > > in an .mako template I can use the global variable c. Is there a way > to call an other controller from the template via h.url_for and still > use the content of the variable c as in the template? > In the called controller c seems to be empty again.
When you go to another controller via h.url_for, it's a separate request with its own 'c' context. If you want to call a controller action from a different controller, you'd instantiate it and call it. But Pylons does so much behind the scenes to set up the controller that I don't know if that would work. It would be better to put common code into a private method in a superclass controller or in a separate function. -- Mike Orr <[email protected]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
