sempare-delphi-template-engine
sempare-delphi-template-engine copied to clipboard
named parameter support for custom functions
allow custom functions to be called, something like:
<% doPrint({ "name" : "peter", "age": 10}) %>
Args can be in any order:
<% doPrint({ "age": 10, "name" : "peter" }) %>
function doPrint(const name:string; const age:integer) : string;
begin
exit(format('%s %d', [name, age])];
end;
may be useful for following use cases:
- to even allow for dict to json type functionality,
- allow for data to be passed around templates more efficiently
related branch is json_support, but will need to review as it is quite old
v1.7.2 includes the initial json / map like variable support, but doesn't support passing to functions yet.