self.render 早就不用带一堆参数了!
self.a = "xxx" 之后 在模版里面可以直接 {{ handler.a }}
令人惊讶的是这些信息都写在
http://www.tornadoweb.org/documentation/overview.html 页面上,
escape: alias for tornado.escape.xhtml_escape
xhtml_escape: alias for tornado.escape.xhtml_escape
url_escape: alias for tornado.escape.url_escape
json_encode: alias for tornado.escape.json_encode
squeeze: alias for tornado.escape.squeeze
linkify: alias for tornado.escape.linkify
datetime: the Python datetime module
handler: the current RequestHandler object
request: alias for handler.request
current_user: alias for handler.current_user
locale: alias for handler.locale
_: alias for handler.locale.translate
static_url: alias for handler.static_url
xsrf_form_html: alias for handler.xsrf_form_html
reverse_url: alias for Application.reverse_url
All entries from the ui_methods and ui_modules Application settings
Any keyword arguments passed to render or render_string
http://www.tornadoweb.org/documentation/template.html 页面上居然只字未提
我估计看完这个以后, 大家都去忙着修改自己现有的代码了