On Wednesday, 6 May 2015 at 14:07:09 UTC, Suliman wrote:
I mean that I know that template can be changes dynamically, but I thought that 99% of dynamic is javascript code...

Templates are like PHP, JSP, LSP etc. They can do stuff on the server side via embedded D code, load files for example. With JS you cannot do this. I think you should also be able to access variables set in query strings (?email=m...@mail.com ...) and process them. But I'm not 100% sure about the latter. The user variables you get like this:

void customHandler(HTTPServerRequest req, HTTPServerResponse res)
{
  auto fields = req.query;  // => ["email":"m...@mail.com"];
}

The drawback of templates is that you have to recompile them after each change atm, which is not very dynamic.

Just have a look at http://vibed.org/templates/diet.

Reply via email to