# ``twisted`.`web`.`_element``

module documentation
(source)

Undocumented

Class | `Element` | Base for classes which can render part of a page.
Class | `Expose` | Helper for exposing methods for various uses using a simple decorator-style callable.
Function | `exposer` | Undocumented
Function | `renderer` | Decorate with `renderer` to use methods as template render directives.
Constant | `T` | Undocumented

def exposer(thunk): (source)

Undocumented

Parameters
thunk:`Callable` | Undocumented
Returns
`Expose` | Undocumented

@exposer
def renderer(): (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>

T = (source)

Undocumented

Value

    TypeVar('T')