Open SkyzohKey opened 8 years ago
You can define a parameter of type HTTPServerResponse
(or also HTTPServerRequest
) and it will automatically get the current request:
@method(HTTPMethod.GET) @path("/")
void index(HTTPServerResponse res) {
auto context = new Mustache.Context;
res.renderTemplate("index", context);
}
With #1938 (for issue #1937), you can access the global response object. That would allow you to write a render
function similar to the one in vibe.web.web
.
Hi dudes, Before exposing my problem, I want to give what you deserve to: Thanks for this awesome work!
My "issue" here is that i would like to not use Diet templates. I imported
mustache-d
successfully, but now I don't know how I can use the result ofMustache.render
and display it on my page. It seems thatHTTPServerResponse.writeBody()
would do the job but i don't understand how I can get a copy of theres
object while being inside aWebInterface
.Here's my current code:
So, the error dmd is telling me is:
Thanks for the future replies ;)