How to declare variable in view scala play framework

(Huor Poeurn) #1

Hello everyone, as I am a fresher of play framework so I don’t know how to declare variable in view scala. Could you help me please?

(Ivano Pagano) #2

Try reading the twirl documentation page for reusing code blocks

I guess what you want is

@myVarName = @{value}

but I won’t expect it to be reassignable (i.e. behaves like a val not a var)

Please verify all I’ve said