Packages

  • package root
    Definition Classes
    root
  • package net
    Definition Classes
    root
  • package liftweb
    Definition Classes
    net
  • package http
    Definition Classes
    liftweb
  • trait S extends HasParams with Loggable with UserAgentCalculator

    An object representing the current state of the HTTP request and response.

    An object representing the current state of the HTTP request and response. It uses the DynamicVariable construct such that each thread has its own local session info without passing a huge state construct around. The S object is initialized by LiftSession on request startup.

    Definition Classes
    http
    See also

    LiftSession

    LiftFilter

  • attr
  • currentAttr

object attr extends AttrHelper[Box]

Used to get an attribute by its name. There are several means to getting attributes:

  // Get a Box for the attribute:
  val myAttr = S.attr("test") openOr "Not found"

  // Get an attribute or return a default value:
  val myAttr = S.attr("name", "Fred")

  // Apply a transform function on the attribute value, or return an Empty:
  val pageSize = S.attr("count", _.toInt) openOr 20

  // There are also prefixed versions:
  val prefixedAttr = S.attr("prefix", "name") openOr "Not found"

Note that this uses the data held in S.attrs, which means that it will find attributes through the entire snippet nesting stack. For example, given the snippets:

<lift:MyStuff.snippetA foo="bar">
  <lift.MyStuff.snippetB>...</lift.MyStuff.snippetB>
</lift:MyStuff.snippetA>

Calling S.attr("foo") from snippetB will return Full("bar").

Linear Supertypes
AttrHelper[Box], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. attr
  2. AttrHelper
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type Info = String
    Definition Classes
    attr → AttrHelper

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 apply[T](prefix: String, key: String, f: (Info) => T, default: => T): T
    Definition Classes
    AttrHelper
  5. def apply[T](key: String, f: (Info) => T, default: => T): T
    Definition Classes
    AttrHelper
  6. def apply[T](prefix: String, key: String, f: (Info) => T): Box[T]
    Definition Classes
    AttrHelper
  7. def apply[T](key: String, f: (Info) => T): Box[T]
    Definition Classes
    AttrHelper
  8. def apply(prefix: String, key: String, default: => Info): Info
    Definition Classes
    AttrHelper
  9. def apply(key: String, default: => Info): Info
    Definition Classes
    AttrHelper
  10. def apply(prefix: String, key: String): Box[Info]
    Definition Classes
    AttrHelper
  11. def apply(key: String): Box[Info]
    Definition Classes
    AttrHelper
  12. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  14. def convert[T](in: Option[T]): Box[T]
    Attributes
    protected
    Definition Classes
    attr → AttrHelper
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  18. def findAttr(prefix: String, key: String): Option[Info]
    Attributes
    protected
    Definition Classes
    attr → AttrHelper
  19. def findAttr(key: String): Option[Info]
    Attributes
    protected
    Definition Classes
    attr → AttrHelper
  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  31. def ~(prefix: String, key: String): Option[NodeSeq]

    Returns the prefixed attribute value as an Option[NodeSeq] for easy addition to the attributes

  32. def ~(key: String): Option[NodeSeq]

    Returns the unprefixed attribute value as an Option[NodeSeq] for easy addition to the attributes

Inherited from AttrHelper[Box]

Inherited from AnyRef

Inherited from Any

Ungrouped