Access Play! 2.0 configuration variables in application.conf

playframework-2.0

Previously in Play! v1 it was really easy to define configuration variables in application.conf and then access them like so:

play.configuration("db.driver")

However now I can't find anything in the documentation for similar uses in v2 or a proper alternative. What's the method for doing so?

Best Solution

The Play 2.0 Scala equivalent to this would be:

Play.current.configuration.getString("db.driver")

You will also need import play.api.Play

The full docs for this are here.