Zend\Mvc\Controller\Plugin\FilePostRedirectGet
Plugin to help facilitate Post/Redirect/Get for file upload forms (http://en.wikipedia.org/wiki/Post/Redirect/Get)
Requires that the Form's File inputs contain a 'fileRenameUpload' filter
with the target option set: 'target' => /valid/target/path'.
This is so the files are moved to a new location between requests.
If this filter is not added, the temporary upload files will disappear
between requests.
Synopsis
class FilePostRedirectGet
extends AbstractPlugin
{
- // members
- protected Container $sessionContainer;
- // Inherited members from AbstractPlugin
- protected null|Dispatchable $controller;
- // methods
- public bool|array|Response __invoke()
- protected Response handlePostRequest()
- protected bool|array handleGetRequest()
- public Container getSessionContainer()
- public FilePostRedirectGet setSessionContainer()
- protected FilePostRedirectGet setProtectedFormProperty()
- protected array|null traverseInputs()
- protected array getNonEmptyUploadData()
- protected array getEmptyUploadData()
- protected Response redirect()
- // Inherited methods from AbstractPlugin
- public void setController()
- public null|Dispatchable getController()
Hierarchy
Members
protected
- $controller — Zend\Mvc\Controller\Plugin\null|Dispatchable
- $sessionContainer — Zend\Session\Container
Methods
protected
- getEmptyUploadData() — Traverse the InputFilter and only return the data of FileInputs that are empty
- getNonEmptyUploadData() — Traverse the InputFilter and only return the data of FileInputs that have an upload
- handleGetRequest()
- handlePostRequest()
- redirect() — TODO: Good candidate for traits method in PHP 5.4 with PostRedirectGet plugin
- setProtectedFormProperty()
- traverseInputs() — Traverse the InputFilter and run a callback against each Input and associated value
public
Inherited from Zend\Mvc\Controller\Plugin\AbstractPlugin
public
- getController() — Get the current controller instance
- setController() — Set the current controller instance