Can't take configuration value in view at 2.5.3 version?

87 Views Asked by At

@play.Play.application.configuration.getString("application.host")

how can I take configuration value in view at 2.5.3 version?

Note that the view is used everywere. So I'm searching solution without setting parameters in all controllers.

1

There are 1 best solutions below

0
On BEST ANSWER
import play.api.Configuration

val config = Configuration.load()
val mode = config.getString("application.host", defaultValueString)

the document is https://www.playframework.com/documentation/2.5.3/api/scala/index.html#play.api.Configuration

Good luck with you