开发者

Best practice for pylons app global tmpl_context settings?

开发者 https://www.devze.com 2023-01-30 10:17 出处:网络
I\'m writing a pylons application, and I\'m w开发者_开发技巧ondering if there is a best practice for where to set some application specific values of the template context object (tmpl_context)?

I'm writing a pylons application, and I'm w开发者_开发技巧ondering if there is a best practice for where to set some application specific values of the template context object (tmpl_context)?

Currently, I've added a __before__() method to the BaseController and am setting up the tmpl_context object with values there but am wondering if there is another place.


I think the BaseController is a good place to put that, either in __call__() or in __before__().


a __before__ method is a right place to do it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号