Hi,
I'm using Finatra which uses Mustache.java in Scala. I'm having trouble getting it to work with template functions that take a parameter. I'm not sure if it's a bug or if I'm misusing the library.
My view class that is fed to mustache.execute looks something like this:
class MyView {
def paramTest(s: String): String = "You passed in: %s".format(s)
}
And I try to use the paramTest method in my template: {{#paramTest}}hello{{/paramTest}}
It *does not* work, nothing is printed out.
However, if I try a function without any parameters:
class MyView {
def paramTest(): String = "You passed in: hardcoded"
}
And then use it like: {{paramTest}}
It *does* work as expected.
If this is a bug I will open an issue and create a test case, otherwise I would appreciate some pointers around what I'm doing wrong.
Also, in case it is relevant, Finatra sets the object handler to TwitterObjectHandler:
mustacheFactory.setObjectHandler(new TwitterObjectHandler)
Thanks!