I am using play framework 1.4.x, In controller , render a List object like this
List<Article> articles = Article.find("Category = ? order by id desc", cateId).fetch();
render(articles)
In views,html template
%{ for (item in articles) { }%
<div>
${item.title}
<li>${item.description}</li>
</div>
%{ } }%
but, the description is to long, need to do some kind of string format,or cut work,then show in the template. I have already google for the template syntax but got nothing.
thanks for @Md Ayub Ali Sarker. but I write a pure scala function in template , It throws a template compilation error.
It has fixed. 1.you can define a function in somewhere like utils. 2.in the views template,you can use these code call the utils function
%{hasBeenCuted = utils.Cut.cut(oginalKeywordsNeedToCut)}%
${hasBeenCuted}
