trait MVCHelper extends DispatchPF
Mix this trait into a class to provide support for MVC style coding. Each controller line is defined as:
serve {
case "user" :: User(user) :: _ => "#name" #> user.firstName
}
The above code matches /user/4, loads the user with primary key 4 from the database, then applies the transform to the /user.html template replacing the node with the id "name" with the firstName of the user
- Alphabetic
- By Inheritance
- MVCHelper
- PartialFunction
- Function1
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type MVCMatch = PartialFunction[List[String], MVCResponse]
The partial function to match a request to a response
The partial function to match a request to a response
- Attributes
- protected
- sealed trait MVCResponse extends AnyRef
A trait that holds a response for the MVCHelper.
A trait that holds a response for the MVCHelper. Conversions exist from Unit (just serve the template), CssBindFunc (do the substitution on the template), NodeSeq (run the template), LiftResponse (send the response back), or Box or Option of any of the above.
- Attributes
- protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def andThen[C](k: PartialFunction[() => Box[LiftResponse], C]): PartialFunction[Req, C]
- Definition Classes
- PartialFunction
- def andThen[C](k: (() => Box[LiftResponse]) => C): PartialFunction[Req, C]
- Definition Classes
- PartialFunction → Function1
- def apply(in: Req): () => Box[LiftResponse]
Apply the Rest helper
Apply the Rest helper
- Definition Classes
- MVCHelper → Function1
- def applyOrElse[A1 <: Req, B1 >: () => Box[LiftResponse]](x: A1, default: (A1) => B1): B1
- Definition Classes
- PartialFunction
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- implicit def boxToResp[T](in: Box[T])(implicit c: (T) => MVCResponse): Box[LiftResponse]
Turn a Box[T] into the return type expected by DispatchPF.
Turn a Box[T] into the return type expected by DispatchPF. Note that this method will return messages from Failure() and return codes and messages from ParamFailure[Int[(msg, _, _, code)
- Attributes
- protected
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compose[R](k: PartialFunction[R, Req]): PartialFunction[R, () => Box[LiftResponse]]
- Definition Classes
- PartialFunction
- def compose[A](g: (A) => Req): (A) => () => Box[LiftResponse]
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def elementWise: ElementWiseExtractor[Req, () => Box[LiftResponse]]
- Definition Classes
- PartialFunction
- def emptyToResp(eb: EmptyBox): Box[LiftResponse]
Convert an Empty into an appropriate LiftResponse.
Convert an Empty into an appropriate LiftResponse. In the case of Failure, you may want to display a particular error message to the user.
- Attributes
- protected
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def isDefinedAt(in: Req): Boolean
Is the Rest helper defined for a given request
Is the Rest helper defined for a given request
- Definition Classes
- MVCHelper → PartialFunction
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lift: (Req) => Option[() => Box[LiftResponse]]
- Definition Classes
- PartialFunction
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def orElse[A1 <: Req, B1 >: () => Box[LiftResponse]](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]
- Definition Classes
- PartialFunction
- def runWith[U](action: (() => Box[LiftResponse]) => U): (Req) => Boolean
- Definition Classes
- PartialFunction
- def saveRedir(what: AnyRef { ... /* 2 definitions in type refinement */ }, where: String): () => Unit
Validate what, if it passes validation, then redirect to the new URL, else display the messages using S.error and redisplay the current page.
Validate what, if it passes validation, then redirect to the new URL, else display the messages using S.error and redisplay the current page.
- Attributes
- protected
- def serve(pf: MVCMatch): Unit
Serve an MVC page based on matching the path
Serve an MVC page based on matching the path
- Attributes
- protected
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- Function1 → AnyRef → Any
- def unapply(a: Req): Option[() => Box[LiftResponse]]
- Definition Classes
- PartialFunction
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object MVCResponse