定制 elstc/cakephp-restore-query 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

elstc/cakephp-restore-query

Composer 安装命令:

composer require elstc/cakephp-restore-query

包简介

Retaining and Restoring query strings plugin for CakePHP 3

README 文档

README

Software License Build Status Codecov Latest Stable Version

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.

Requirements

  • CakePHP 3.x

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require elstc/cakephp-restore-query

Add the following line to your application config/bootstrap.php:

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

Usage

Retaining query string

Load the component with your controller's initialize method.

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.

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.

    <?=
    $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.

default: ['index', 'search']

sessionKey

Name of session key for query string saving

default: 'StoredQuerystring'

restoreKey

Name of the query string for restore action.

default: '_restore'

redirect

Redirect when restoring the query string.

default: true

统计信息

  • 总下载量: 53
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固