RedirectPost
Considerations
Plugin to redirect and save post.
You can use three types of the storage: session, cache and cookie.
When loadComponent:
$this->loadComponent( 'RedirectPost.Redirect', ['storage'=>'session|cache|cookie']);
Use the force, read the code.
Requirements
cakePHP 3
Installation
$ composer require adrianodemoura/redirect-post
src/Application.php
:
In parent::bootstrap();
$this->addPlugin('RedirectPost');
Usage
In Controller:
public function initialize()
{
parent::initialize();
$this->loadComponent('RedirectPost.Redirect');
}
to save and redirect:
$data = $this->request->getData();
$this->Redirect->save( ['action'=>'acton_target'], $data);
to read:
$data = $this->Redirect->read();
to delete:
$this->Redirect->delete();
Check
vendor/cakephp-plugins.php
:
In 'RedirectPost' => $baseDir . '/vendor/adrianodemoura/redirect-post/',
vendor/composer/autoload_psr4.php
:
In 'RedirectPost\\' => array($vendorDir . '/adrianodemoura/redirect-post/src'),
'RedirectPost\\Test\\' => array($vendorDir . '/adrianodemoura/redirect-post/tests'),