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.

The first template argument is the name of the template file. All following arguments must be pairs of a type and a string, each specifying one parameter. Parameter values can be passed either as a value of the same type as specified by the template arguments, or as a Variant which has the same type stored.

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.

Prototype

void renderCompat(string template_file, TYPES_AND_NAMES...)(...)(
   ...
);

Examples

string title = "Hello, World!";
int pageNumber = 1;
res.renderCompat!("mytemplate.jd",
	string, "title",
	int, "pageNumber")
	(title, 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.