brenoroosevelt / cakephp-pagination-cache
Pagination Cache plugin for CakePHP 3.x
Installs: 88
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:cakephp-plugin
Requires
- php: >=5.5.9
- cakephp/cakephp: >=3.3.2 <4.0.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-16 07:25:14 UTC
README
Installation
You can install this plugin into your CakePHP application using composer.
The recommended way to install composer packages is:
composer require brenoroosevelt/cakephp-pagination-cache
Load the plugin
Add following to your config/bootstrap.php
Plugin::load('BRPaginationCache');
Usage
Controller class
public function index() { // load component with setup param $this->loadComponent('BRPaginationCache.PaginationCache', [ 'session' => 'posts_pagination' ]); // restore pagination from session $this->PaginationCache->restore(); // pagination $this->set('posts', $this->paginate($this->Posts)); // save pagination from session $this->PaginationCache->save(); }
Persisting pagination params (session)
All params are persisted using sessions. Make sure to load the Session component.