Skip to content

Add request.render() support #39

@hueniverse

Description

@hueniverse

The server.render() method does not work when used inside a request handler via request.server.render() when the view manager was created by a plugin. This is breaks because the request.server does not have access to the plugin realm where the view manager is configured (only has access to a view manager setup directly on the server root outside of any plugin).

The request.render() method works exactly the same way but it gets its realm from the route the request was bound to instead of the global server root.

Note that this will not work in onRequest extensions added by the plugin because the route isn't yet set at this point in the request lifecycle and the request.render() method will produce the same limited results server.render() can. If you need to call render() within onRequest, save a reference to the views manager direction from server.realm.plugins.vision.manager within the plugin and use that in the extension method.

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions