Fully Qualified Name: | Laminas\Mvc\Plugin\Prg\PostRedirectGet |
Extends: | AbstractPlugin |
Plugin to help facilitate Post/Redirect/Get (http://en.wikipedia.org/wiki/Post/Redirect/Get)
Name | Description | Defined By |
---|---|---|
__invoke() | Perform PRG logic | PostRedirectGet |
getController() | Get the current controller instance | AbstractPlugin |
getSessionContainer() | PostRedirectGet | |
setController() | Set the current controller instance | AbstractPlugin |
setSessionContainer() | PostRedirectGet |
Perform PRG logic
If a null value is present for the $redirect, the current route is retrieved and use to generate the URL for redirect.
If the request method is POST, creates a session container set to expire after 1 hop containing the values of the POST. It then redirects to the specified URL using a status 303.
If the request method is GET, checks to see if we have values in the session container, and, if so, returns them; otherwise, it returns a boolean false.
Parameter Name | Type | Description |
---|---|---|
$redirect | null|string | |
$redirectToUrl | bool |
Returns: \Laminas\Http\Response|array|\Traversable|bool
Get the current controller instance
Returns: null|\Dispatchable
Returns: \Container
Set the current controller instance
Parameter Name | Type | Description |
---|---|---|
$controller | \Dispatchable |
Returns: void
Parameter Name | Type | Description |
---|---|---|
$container | \Container |
Returns: \PostRedirectGet