首页 > 解决方案 > 如何在 Twirl 模板中使用 play-bootstrap

问题描述

我是一个游戏新手,我很难弄清楚我需要哪些导入以及将它们放在哪里以便使用play-bootstrap。我已将库添加为依赖项("com.adrianhurt" %% "play-bootstrap" % "1.5.1-P27-B4"),然后在我的模板中,我尝试使用:

@b4.vertical.form(routes.AccountController.handleSubscriptionForm) { implicit vfc =>
    @helper.CSRF.formField

    @b4.email(form("email"))
    // ...and so on
}

但是模板无法编译并出现奇怪的错误消息:

Expected '"' but found 'EOF'

我确定我需要以某种方式导入@b4模板上下文,但我不明白如何。

PS。我可以毫无问题地使用“标准”播放助手,以下工作完美:

@helper.form(routes.AccountController.handleSubscriptionForm) {
    @helper.CSRF.formField

    @helper.inputText(form("email"))

为了使用 play bootstrap 助手,我必须做什么?

标签: scalaplayframeworkbootstrap-4play-bootstrap

解决方案


推荐阅读