You are not logged in.
I try use method:
/// renders the {{mustache}} template from JSON defined context
// - the context is given via a JSON object, defined with parameters
// - you can specify a list of partials via TSynMustachePartials.CreateOwned,
// a list of Expression Helpers, or a custom {{"English text}} callback
// - is just a wrapper around Render(_JsonFastFmt())
// - you can write e.g. with the extended JSON syntax:
// ! html := mustache.RenderJSON('{name:?,value:?}',[],['Chris',10000]);
// - set EscapeInvert = true to force {{value}} NOT to escape HTML chars
// and {{{value}} escaping chars (may be useful e.g. for code generation)
function RenderJSON(const JSON: RawUTF8; const Args,Params: array of const;
Partials: TSynMustachePartials=nil; Helpers: TSynMustacheHelpers=nil;
OnTranslate: TOnStringTranslate=nil;
EscapeInvert: boolean=false): RawUTF8; overload;
but what is Args parameter? In the above example Args is passed as empty array.
Offline
See FormatUTF8:
https://synopse.info/files/html/api-1.1 … FORMATUTF8
Offline
Look closely. See that in the RenderJSON() function the Params parameter is next to the Args parameter:
const Args,Params: array of const;
And Params parameter contains values as in FormatUTF8(). But for what is Args?
Last edited by jaclas (2018-08-18 09:46:10)
Offline
Offline