play.api

Play

Related Doc: package api

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: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Definition Classes
    AnyRef → Any
  4. def application(implicit app: Application): Application

    Returns the current application.

  5. final def asInstanceOf[T0]: T0

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

    Returns the current application classloader.

  7. def clone(): AnyRef

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

    Returns the current application configuration.

  9. 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.

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

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

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

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

    Definition Classes
    AnyRef → Any
  14. 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

  15. 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

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

    Returns the current application global settings.

  17. def hashCode(): Int

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

    Returns true if the current application is DEV mode.

  19. final def isInstanceOf[T0]: Boolean

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

    Returns true if the current application is PROD mode.

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

    Returns true if the current application is TEST mode.

  22. def langCookieHttpOnly(implicit messagesApi: MessagesApi): Boolean

    Returns whether the language cookie should have the HTTP only flag set.

  23. def langCookieName(implicit messagesApi: MessagesApi): String

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

  24. def langCookieSecure(implicit messagesApi: MessagesApi): Boolean

    Returns whether the language cookie should have the secure flag set.

  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): Router

    Returns the current application router.

  33. def start(app: Application): Unit

    Starts this application.

    Starts this application.

    app

    the application to start

  34. def stop(app: Application): Unit

    Stops the given 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