Reputation: 4174
I'am in new in play framework and i have a doubt about these questions any experts in play framework shouldanswer these questions
In play framework the scala methods are how to invoke inside view ?
these method will create inside the application or model in the project
with regards, Prasanth AR
my language is not good I know, and sorry about that
Upvotes: 1
Views: 235
Reputation: 21557
To define a method inside Twirl's template add @
before the name and code block
@incr(number: Int) = @{ @number + 1 }
To invoke scala method or variable add @
symbol before the name
<div>@incr(10)</div>
Will return and print 11
in div
block
Upvotes: 3