You are not logged in.
Pages: 1
Hi there!
I have a question about sections in mustache.
For example, I have the following code as a template:
{{#names}}
The friend of {{name}} is {{friend}}.
{{/names}}
It should be very easy. There is a name who got a friend.
I have more than one name with different friends, how can I realize that?
TDocVariant.New(doc);
doc.names := true;
doc.name := 'Peet'; // Here I want to get more names
doc.friend := 'James'; // and more friends
mustache := TSynMustache.Parse(myHTML);
html := mustache.Render(doc);
I want to have some output like this:
The friend of Peet is James.
The friend of Olaf is Tom.
The friend of...
How can i realize that?
Offline
Pages: 1