t.w.t.renderer() : function documentation

Part of twisted.web.template View Source

Decorate with renderer to use methods as template render directives.

For example:

   class Foo(Element):
       @renderer
       def twiddle(self, request, tag):
           return tag('Hello, world.')

   <div xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1">
       <span t:render="twiddle" />
   </div>

Will result in this final output:

   <div>
       <span>Hello, world.</span>
   </div>
API Documentation for Twisted, generated by pydoctor at 2012-12-26 12:18:15.