5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Play2のテンプレートエンジン内でちょっとした変数を定義する

Last updated at Posted at 2014-03-06

本来はAction側で定義するべきだとは思うが、ホントにちょっとした変数を定義して
使いたい場合。
例えば設定ファイルから値を読み込んで使いたい場合は、

@(id:Int)

@import com.typesafe.config.ConfigFactory; val hoge = ConfigFactory.load().getString("hogege")

<span>@hoge</span>

的な感じでイケるらしい。

5
6
1

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
5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?