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

category Zend
package Zend_Mvc
subpackage Controller

 Methods

Perform PRG logic

__invoke(null | string $redirect, bool $redirectToUrl) : \Zend\Http\Response | array | \Zend\Mvc\Controller\Plugin\Traversable | false

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

$redirect

nullstring

$redirectToUrl

bool

Returns

\Zend\Http\Responsearray\Zend\Mvc\Controller\Plugin\Traversablefalse

Get the current controller instance

getController() : null | \Zend\Stdlib\DispatchableInterface
Inherited

inherited_from \Zend\Mvc\Controller\Plugin\AbstractPlugin::getController()

Returns

Retrieve the session manager

getSessionManager() : \Zend\Session\ManagerInterface

If none composed, lazy-loads a SessionManager instance

Returns

Set the current controller instance

setController(\Zend\Stdlib\DispatchableInterface $controller) : void
Inherited

inherited_from \Zend\Mvc\Controller\Plugin\AbstractPlugin::setController()

Parameters

Set the session manager

setSessionManager(\Zend\Session\ManagerInterface $manager) : \Zend\Mvc\Controller\Plugin\FlashMessenger

 Properties

 

$controller

$controller : null | \Zend\Stdlib\DispatchableInterface
Inherited

inherited_from \Zend\Mvc\Controller\Plugin\AbstractPlugin::$$controller
 

$session

$session : \Zend\Session\ManagerInterface