Bind a query string parameter.
Bind a query string parameter.
Parameter key
QueryString data
None
if the parameter was not present in the query string data. Otherwise, returns Some
of either
Right
of the parameter value, or Left
of an error message if the binding failed.
Unbind a query string parameter.
Unbind a query string parameter.
Parameter key
Parameter value.
a query string fragment containing the key and its value. E.g. "foo=42"
Javascript function to unbind in the Javascript router.
Binder for query string parameters.
You can provide an implementation of
QueryStringBindable[A]
for any typeA
you want to be able to bind directly from the request query string.For example, if you have the following type to encode pagination:
Play will create a
Pager(5, 42)
value from a query string looking like/foo?p.index=5&p.size=42
if you define an instance ofQueryStringBindable[Pager]
available in the implicit scope.For example:
To use it in a route, just write a type annotation aside the parameter you want to bind: