On Feb 23, 2009, at 2:13 PM, Eber Freitas Dias wrote: > Hi guys! > > First of all I want to thank you all for your responses on my > message about coming from CakePHP to web.py! I'm really digging it > and reading it's documentation (I'm on the cookbook now) and I have > one question. > > Imagine that I'm building a blog and I wanna display the top posts > on a sidebar. That would happen on each and every page so the > logical place for this code is on the layout template. But how can I > define the list of posts to the layout? In CakePHP we have a method > that get's executed before the actual method being requested > everytime, and than we can set this kind of variables there. I saw > that web.py has something like it, the processors. Should I use > that? Does anyone has an example?
You pass all variables as arguments to the render function, and if you define them at the top of your template, they then become usable. Alec --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" 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/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
