0
我想在視圖文件中聲明一個scala變量。如何做呢?在聲明中聲明一個scala變量2
@(title: String)(content: Html)
//this line isnt compiling. I tried without the word defining but it doesn't work either
@defining(l:Seq[String] = Seq("hello","hello2"))
<html><head>...
<body>
@content
//I want to use the list here
<ul id="hardcode-list" >
@l.map{item=><li>item</li>}
</ul>
</body>
</head></html>
的可能的複製[玩2.0中創建一個變量,並賦值(http://stackoverflow.com/questions/11232772/玩-2-0-創建-A-可變和分配值) –