1438. Class

1438.1. Zend\Mvc\Controller\Plugin\PostRedirectGet

Plugin to help facilitate Post/Redirect/Get (http://en.wikipedia.org/wiki/Post/Redirect/Get)

1438.1.1. Methods

1438.1.1.1. __invoke

__invoke()

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.

Parameters:
  • null|string
  • bool
Return type:

ZendHttpResponse|array|Traversable|false

1438.1.1.2. getSessionContainer

getSessionContainer()

@return Container

1438.1.1.3. setSessionContainer

setSessionContainer()

@param Container $container

Return type:PostRedirectGet

1438.1.1.4. redirect

redirect()

TODO: Good candidate for traits method in PHP 5.4 with FilePostRedirectGet plugin

Parameters:
  • string
  • boolean
Return type:

Response

Throws :

ZendMvcExceptionRuntimeException

Project Versions

Table Of Contents

Previous topic

1437. Class

Next topic

1439. Class

This Page