LoginSignup
15
15

More than 5 years have passed since last update.

PlayFrameworkのScala Template内で変数を定義する

Last updated at Posted at 2014-05-14

Scala Template内でも簡単に変数を定義することができる。

// 定義サンプル
@hoge = @{"aaa"}
@one = @{1}
@two = @{2}

@main("タイトル") {
    // 出力サンプル
    @hoge    // aaa が出力される
    @{one + two} // 3 が出力される
}

※HTMLコンテンツのブロック内には定義できないので注意。

15
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
15