play.api

Play

object Play

High-level API to access Play global features.

Note that this API depends on a running application. You can import the currently running application in a scope using:

import play.api.Play.current
Source
Play.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Play
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def application(implicit app: Application): Application

    Returns the current application.

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def classloader(implicit app: Application): ClassLoader

    Returns the current application classloader.

  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def configuration(implicit app: Application): Configuration

    Returns the current application configuration.

  11. implicit def current: Application

    Implicitly import the current running application in the context.

    Implicitly import the current running application in the context.

    Note that by relying on this, your code will only work properly in the context of a running application.

  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  16. def getExistingFile(relativePath: String)(implicit app: Application): Option[File]

    Retrieves a file relative to the current application root path.

    Retrieves a file relative to the current application root path.

    For example, to retrieve a configuration file:

    val myConf = application.getExistingFile("conf/myConf.yml")
    relativePath

    relative path of the file to fetch

    returns

    an existing file

  17. def getFile(relativePath: String)(implicit app: Application): File

    Retrieves a file relative to the current application root path.

    Retrieves a file relative to the current application root path.

    For example, to retrieve a configuration file:

    val myConf = application.getFile("conf/myConf.yml")
    relativePath

    the relative path of the file to fetch

    returns

    a file instance; it is not guaranteed that the file exists

  18. def global(implicit app: Application): GlobalSettings

    Returns the current application global settings.

  19. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  20. def isDev(implicit app: Application): Boolean

    Returns true if the current application is DEV mode.

  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. def isProd(implicit app: Application): Boolean

    Returns true if the current application is PROD mode.

  23. def isTest(implicit app: Application): Boolean

    Returns true if the current application is TEST mode.

  24. def langCookieName(implicit app: Application): String

    Returns the name of the cookie that can be used to permanently set the user's language.

  25. def maybeApplication: Option[Application]

    Optionally returns the current running application.

  26. def mode(implicit app: Application): Mode.Mode

    Returns the current application mode.

  27. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  28. final def notify(): Unit

    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  30. def resource(name: String)(implicit app: Application): Option[URL]

    Scans the current application classloader to retrieve a resource.

    Scans the current application classloader to retrieve a resource.

    For example, to retrieve a configuration file:

    val maybeConf = application.resource("conf/logger.xml")
    name

    absolute name of the resource (from the classpath root)

    returns

    the resource URL, if found

  31. def resourceAsStream(name: String)(implicit app: Application): Option[InputStream]

    Scans the current application classloader to retrieve a resources contents as a stream.

    Scans the current application classloader to retrieve a resources contents as a stream.

    For example, to retrieve a configuration file:

    val maybeConf = application.resourceAsStream("conf/logger.xml")
    name

    Absolute name of the resource (from the classpath root).

    returns

    Maybe a stream if found.

  32. def routes(implicit app: Application): Option[core.Router.Routes]

    Returns the current application router.

  33. def start(app: Application): Unit

    Starts this application.

  34. def stop(): Unit

    Stops the current application.

  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  36. def toString(): String

    Definition Classes
    AnyRef → Any
  37. def unsafeApplication: Application

    Returns the currently running application, or null if not defined.

  38. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped