       @locals[k] = ->
         v(@context, @, arguments)
 
+    @locals.defs = @app.defs
     @locals.postrenders = @app.postrenders
     @locals.views = @app.views
     @locals.layouts = @app.layouts

      @locals[k] = ->
        v(@context, @, arguments)

    @locals.postrenders = @postrenders
    @locals.views = @views
    @locals.layouts = @layouts

      postrender = @postrenders[options.apply]
      body = jquery('body')
      body.empty().html(result)
      postrender opts.context, jquery.extend(@defs, {$: jquery})
      result = body.html()

    if options.layout
