diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-06-29 13:07:42 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-06-29 13:07:42 +0200 |
commit | 3502a55dde1635c21dedb27de2a66316e03d350e (patch) | |
tree | a1ae54adbd7f78ab4be4d018155f6f0007ee0b4f /zend-mvc-plugin-prg-8c7ccb9f0004e92ff258b483447d914f42cb7448/doc | |
parent | c4a7368d043f26ad1ca510b13c112fa2ccdba74f (diff) |
php-zendframework-zend-mvc-plugin-prg: clean
Diffstat (limited to 'zend-mvc-plugin-prg-8c7ccb9f0004e92ff258b483447d914f42cb7448/doc')
-rw-r--r-- | zend-mvc-plugin-prg-8c7ccb9f0004e92ff258b483447d914f42cb7448/doc/book/index.html | 93 | ||||
l--------- | zend-mvc-plugin-prg-8c7ccb9f0004e92ff258b483447d914f42cb7448/doc/book/index.md | 1 |
2 files changed, 0 insertions, 94 deletions
diff --git a/zend-mvc-plugin-prg-8c7ccb9f0004e92ff258b483447d914f42cb7448/doc/book/index.html b/zend-mvc-plugin-prg-8c7ccb9f0004e92ff258b483447d914f42cb7448/doc/book/index.html deleted file mode 100644 index 64f69c9..0000000 --- a/zend-mvc-plugin-prg-8c7ccb9f0004e92ff258b483447d914f42cb7448/doc/book/index.html +++ /dev/null @@ -1,93 +0,0 @@ -<div class="container"> - <div class="jumbotron"> - <h1>zend-mvc-plugin-prg</h1> - - <p>Post/Redirect/Get plugin for zend-mvc controllers.</p> - - <pre><code class="language-bash">$ composer require zendframework/zend-mvc-plugin-prg</code></pre> - </div> -</div> - -<div class="container"> - <div class="row"> - <div class="col-xs-12 col-sm-6"> - <div class="panel panel-info"> - <div class="panel-heading"> - <h2 class="panel-title">Installation</h2> - </div> - - <div class="panel-body"> - <p> - Install via composer: - </p> - - <pre><code class="lang-bash" data-trim> -$ composer require zendframework/zend-mvc-plugin-prg - </code></pre> - - <p> - If you are using the <a href="https://zendframework.github.io/zend-component-installer">zend-component-installer</a>, - you're done! - </p> - - <p> - If not, you will need to add the component as a module to your - application. Add the entry <code>'Zend\Mvc\Plugin\Prg'</code> to - your list of modules in your application configuration (typically - one of <code>config/application.config.php</code> or - <code>config/modules.config.php</code>). - </p> - </div> - </div> - </div> - - <div class="col-xs-12 col-sm-6"> - <h2>Usage</h2> - - <p> - When a user sends a POST request (e.g. after submitting a form), their - browser will try to protect them from sending the POST again, breaking - the back button, causing browser warnings and pop-ups, and sometimes - reposting the form. Instead, when receiving a POST, we should store the - data in a session container and redirect the user to a GET request. - </p> - - <p>This plugin can be invoked with two arguments:</p> - - <ul> - <li><code>$redirect</code>, a string containing the redirect location, - which can either be a named route or a URL, based on the contents of - the second parameter.</li> - <li><code>$redirectToUrl</code>, a boolean that when set to - <code>TRUE</code>, causes the first parameter to be treated as a URL - instead of a route name (this is required when redirecting to a URL - instead of a route). This argument defaults to <code>FALSE</code>.</li> - </ul> - - <p>When no arguments are provided, the current matched route is used.</p> - - <h3>Example Usage</h3> - - <pre><code class="lang-php" data-trim> -// Pass in the route/url you want to redirect to after the POST -$prg = $this->prg('/user/register', true); - -if ($prg instanceof \Zend\Http\PhpEnvironment\Response) { - // Returned a response to redirect us. - return $prg; -} - -if ($prg === false) { - // This wasn't a POST request, but there were no params in the flash - // messenger; this is probably the first time the form was loaded. - return ['form' => $myForm]; -} - -// $prg is an array containing the POST params from the previous request -$form->setData($prg); - -// ... your form processing code here - </code></pre> - </div> - </div> -</div> diff --git a/zend-mvc-plugin-prg-8c7ccb9f0004e92ff258b483447d914f42cb7448/doc/book/index.md b/zend-mvc-plugin-prg-8c7ccb9f0004e92ff258b483447d914f42cb7448/doc/book/index.md deleted file mode 120000 index fe84005..0000000 --- a/zend-mvc-plugin-prg-8c7ccb9f0004e92ff258b483447d914f42cb7448/doc/book/index.md +++ /dev/null @@ -1 +0,0 @@ -../../README.md
\ No newline at end of file |