play フレームワークと scala テンプレートは初めてです。マップをループして、要素ごとに入力タグを作成し、昇順のタグ ID を使用する必要があります。したがって、結果のhtmlに入れたいのは次のようなものです。
<li><input id="option1" type="checkbox"/><label for="option1">sometext</label></li>
<li><input id="option2" type="checkbox"/><label for="option2">sometext</label></li>
<li><input id="option3" type="checkbox"/><label for="option3">sometext</label></li>
入力の量は動的であり、それらの ID は昇順である必要があります。
これは私が現在持っているもので、マップをループするだけです:
@for(c <- frage.getAllChoices){
<li><input id="option1" type="checkbox"/><label for="option1">@c.getText()</label</li>
}
#define を使用してみましたが、後で値を変更することはできません。式を出力するだけです。また、「var」を使用して変数を作成することは、play scala テンプレートでは不可能です。