Ariod
Ariod

Reputation: 5851

Custom model in Groovy templates

Is it possible to have a custom, map-like class (although not related to map) in a Groovy template, in a way that I can specify how properties from my custom class are mapped to model properties? E.g. if we have property $firstName I would like to customize how firstName is obtained from my custom class.

Upvotes: 0

Views: 133

Answers (1)

melix
melix

Reputation: 1530

If you use the MarkupTemplateEngine, yes, it is possible. See http://groovy-lang.org/templating.html#markuptemplate-basetemplate

Upvotes: 1

Related Questions