jehugaleahsa / mustache-sharp

An extension of the mustache text template engine for .NET.
The Unlicense
306 stars 78 forks source link

Tags with multiple arguments #12

Open dalbello opened 11 years ago

dalbello commented 11 years ago

First of all, great work. =) Love what' you've done.

I have a quick question, I've done a proof of concept using your code to generate HTML invoices. I created a Tag to calculate the total amount of the invoice which has to multiply item price x quantity for each row and sum all values. The issue that I'm facing is that I had to hard code the name of the fields that contain the price and quantity in my code, in the current code base would be possible to have something like this: ${{#total Products:[ItemPrice, Quantity]}}? Right now I have: ${{#total Products}} and have on my code the fields that should be used on the calculation. That's only a problem for me because the data comes from a json that is generated based a form builder system and people can name their fields however they want.

Cheers Luis