Method HttpServerResponse.renderCompat

Compatibility version of render() that takes a list of explicit names and types instead of variable aliases.

This version of render() works around a compiler bug in DMD (Issue 2962). You should use this method instead of render() as long as this bug is not fixed.

Note that the variables are copied and not referenced inside of the template - any modification you do on them from within the template will get lost.

Prototypes

void renderCompat((string template_file,TYPES_AND_NAMES...))(
  Variant[] args...
);

Examples

string title = "Hello, World!";
int pageNumber = 1;
res.renderCompat!("mytemplate.jd",
	string, "title",
	int, "pageNumber")
	(Variant(title), Variant(pageNumber));

Authors

Sönke Ludwig, Jan Krüger

Copyright

© 2012 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.