模板 scala Playframwork

template scala Playframwork

这是我第一个使用 scala 模板的 play 框架项目,我期待着一些帮助。 当我编译我的代码时,它会产生一个错误: '(' 预期但 ')' 找到

 @(produits : List[models.Produit], messages : List[String])
        <div class="container padding-top-10">
            <div class="jumbotron">
                <form class="register form-horizontal" action="@routes.Application.objectif_dc()" method="POST">

                    <label for="produit">
                        produit :
                        <br/>
                        <select name="produit" class="form-control">
                            @for ( produit <- produits){
                            <option value="@(produit.id)"> @(produit.type) </option>
                            }
                        </select>
                    </label>

                    <br/>
                    <br/>
                    <label for="cible">
                        cible :
                        <br/>
                        <select name="cible" class="form-control">
                            <option value="cdd" selected>chef de departement direct</option>
                            <option value="cdi">chef de departement indirect</option>
                        </select>
                    </label>

                    <br/>
                    <br/>
                    <label for="objectif">
                        Objectif :
                        <br/>
                        <input type="text" class="form-control" name="objectif" placeholder="objectif" value="" />
                    </label>
                    <br/>
                    <br/>
                    <button class="btn btn-default" type="submit">envoyer</button>
                </form>
            </div>
        </div>

删除 @for 和左括号 ( 之间的 space。

Twirl 对这些事情很敏感。