adrianodemoura/redirect-post

Componente redirectPost para cakePHP 3

Installs: 39

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Language:HTML

Type:cakephp-plugin

1.0 2020-02-25 17:11 UTC

This package is auto-updated.

Last update: 2024-03-26 01:51:34 UTC


README

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

In src/Application.php:

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

In vendor/cakephp-plugins.php:

'RedirectPost' => $baseDir . '/vendor/adrianodemoura/redirect-post/',

In vendor/composer/autoload_psr4.php:

'RedirectPost\\' => array($vendorDir . '/adrianodemoura/redirect-post/src'),
'RedirectPost\\Test\\' => array($vendorDir . '/adrianodemoura/redirect-post/tests'),

Test

access http://localhost/youcake3/redirect-post/painel