Closed zlx closed 8 years ago
I'm not 100% sure of your requirements, but I think a lambda is is probably the right approach. You can put a set of "filter lambdas" into your top-level context, like:
Map<String,Object> ctx = new HashMap<>();
ctx.put("upcase", new Template.Lambda() {
public void execute (Template.Fragment frag, Writer out) {
String contents = frag.execute();
out.write(contents.toUpperCase());
}
});
and so forth for all the filters you want.
Hi, @samskivert, It seem the filter lambda is match my requirements. Thanks
Hi
sorry about disturb. I use the library in my project. It's so great for mostly case.
But when I want to make some simple convert, for eg: phone_number => phoneNumber, It's seem hard.
Does it have some way to complete the convert now? AKA does it support some method like https://github.com/Shopify/liquid/wiki/Liquid-for-Designers#standard-filters
Thank you.