2017 © Pedro Peláez
 

cakephp-plugin cakephp-restore-query

Retaining and Restoring query strings plugin for CakePHP 3

image

elstc/cakephp-restore-query

Retaining and Restoring query strings plugin for CakePHP 3

  • Wednesday, May 9, 2018
  • by nojimage
  • Repository
  • 1 Watchers
  • 0 Stars
  • 30 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 76 % Grown

The README.md

Retaining and Restoring query strings plugin for CakePHP

Software License Build Status Codecov Latest Stable Version , (*1)

This plugin provides a component that makes it possible to restore the conditions in the list, search page, etc. even after transitioning to another page., (*2)

Requirements

  • CakePHP 3.x

Installation

You can install this plugin into your CakePHP application using composer., (*3)

The recommended way to install composer packages is:, (*4)

composer require elstc/cakephp-restore-query

Add the following line to your application config/bootstrap.php:, (*5)

use Cake\Core\Plugin;
Plugin::load('Elastic/RestoreQuery');

Usage

Retaining query string

Load the component with your controller's initialize method., (*6)

class AppController extends Controller
{
    public function initialize()
    {
        $this->loadComponent('Elastic/RestoreQuery.RestoreQuery', [
            'actions' => ['index', 'search'], // List of actions to record query string
        ]);
    }
}

The component automatically saves the Query string for the target action., (*7)

Restore saved query string

By creating a link in the template as follows, the component will call the saved query string and redirect to the target page., (*8)

    <?=
    $this->Html->link('link text', [
        'action' => 'index',
        '?' => ['_restore' => true], // NOTE: _restore=true, the component will restore the saved query.
    ]);
    ?>

Elastic/RestoreQuery.RestoreQueryComponent Options

actions

List of actions to record the query string., (*9)

default: ['index', 'search'], (*10)

sessionKey

Name of session key for query string saving, (*11)

default: 'StoredQuerystring', (*12)

restoreKey

Name of the query string for restore action., (*13)

default: '_restore', (*14)

redirect

Redirect when restoring the query string., (*15)

default: true, (*16)

The Versions

09/05 2018

0.4.x-dev

0.4.9999999.9999999-dev

Retaining and Restoring query strings plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

The Development Requires

09/05 2018

v0.4.1

0.4.1.0

Retaining and Restoring query strings plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

The Development Requires

09/05 2018

0.2.x-dev

0.2.9999999.9999999-dev

Retaining and Restoring query strings plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

The Development Requires

09/05 2018

v0.2.2

0.2.2.0

Retaining and Restoring query strings plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

The Development Requires

09/05 2018

dev-master

9999999-dev

Retaining and Restoring query strings plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

The Development Requires

09/05 2018

v0.5.1

0.5.1.0

Retaining and Restoring query strings plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

The Development Requires

18/04 2018

v0.5.0

0.5.0.0

Retaining and Restoring query strings plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

The Development Requires

18/04 2018

v0.4.0

0.4.0.0

Retaining and Restoring query strings plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

The Development Requires

18/04 2018

v0.2.1

0.2.1.0

Retaining and Restoring query strings plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

The Development Requires

18/04 2018

v0.2.0

0.2.0.0

Retaining and Restoring query strings plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

The Development Requires