NAME
Jifty::Request::Mapper - Maps response values into arbitrary query parameters
DESCRIPTION
Jifty::Request::Mapper is used to insert values into parameters that you can't know when you originally constructed the request. The prime example of this is a Create action to a View page -- where you can't know what ID to supply to the View page until after the Create action has run. This problem can be fixed by establishing a mapping between some part of the Jifty::Result of the Create action, and the ID query parameter.
METHODS
query_parameters HASH
Extended syntax for generating query parameters. This is used by Jifty::Web::Form::Clickable for its parameters argument, as well as for results of continuations.
Possible formats for each key => value pair in the HASH are:
KEY => STRING-
The simplest form -- the
KEYwill have the literal value of theSTRINGsupplied KEY => { result => ACTION }-
The
KEYwill take on the value of the content namedKEYfrom the result of theACTION.ACTIONmay either be a Jifty::Action object, or a moniker thereof. KEY => { result => ACTION, name => STRING }-
The
KEYwill take on the value of the content namedSTRINGfrom the result of theACTION.ACTIONmay either be a Jifty::Action object, or a moniker thereof. KEY => { request_argument => STRING }-
The
KEYwill take on the value of the argument namedSTRINGfrom the request. KEY => { argument => ACTION }-
The
KEYwill take on the value of the argument namedKEYfrom theACTION.ACTIONmay either be a Jifty::Action object, or a moniker thereof. KEY => { argument => ACTION. name => STRING }-
The
KEYwill take on the value of the argument namedSTRINGfrom theACTION.ACTIONmay either be a Jifty::Action object, or a moniker thereof.
result_of and argument_to are valid synonyms for result and argument, above.
map PARAMHASH
Responsible for doing the actual mapping that "query_parameters" above sets up. That is, takes magical query parameters and extracts the values they were meant to have.
- destination
-
The
keyfrom a query parameter - source
-
The
valueof a query parameter - request
-
The Jifty::Request object to pull action arguments from. Defaults to the current request.
- response
-
The Jifty::Response object to pull results from. Defaults to the current response.
Returns a key => value pair.