trait PathBindable[A] extends AnyRef
Ordering
- Alphabetic
- By Inheritance
Inherited
- PathBindable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Abstract Value Members
- abstract def bind(key: String, value: String): Either[String, A]
Bind an URL path parameter.
Bind an URL path parameter.
- key
Parameter key
- value
The value as String (extracted from the URL path)
- returns
Right
of the value orLeft
of an error message if the binding failed
- abstract def unbind(key: String, value: A): String
Unbind a URL path parameter.
Unbind a URL path parameter.
- key
Parameter key
- value
Parameter value.
Concrete Value Members
- def javascriptUnbind: String
Javascript function to unbind in the Javascript router.
- def transform[B](toB: (A) => B, toA: (B) => A): PathBindable[B]
Transform this PathBinding[A] to PathBinding[B]
Binder for URL path parameters.
You can provide an implementation of
PathBindable[A]
for any typeA
you want to be able to bind directly from the request path.For example, given this class definition:
You can define a binder retrieving a
User
instance from its id, useable like the following:The definition of binder can look like the following: