slince / cakephp-pjax
A pjax middleware for CakePHP 3
Installs: 1 178
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 1
Type:cakephp-plugin
Requires
- php: >=5.6.0
- cakephp/cakephp: ^3.0
- symfony/css-selector: ^2.7|^3.0
- symfony/dom-crawler: ^2.7|^3.0
Requires (Dev)
- phpunit/phpunit: ^5.0|^6.0
This package is auto-updated.
Last update: 2024-11-08 18:51:58 UTC
README
This plugin for version 3 the CakePHP Framework. Pjax is a jQuery plugin that leverages ajax to speed up the loading time of your pages. It works by only fetching specific html fragments from the server, and client-side updating only happens on certain parts of the page.
The package provides a middleware that can return the response that the jQuery plugin expects.
Installation
You can install the package via composer:
$ composer require slince/cakephp-pjax
Load Plugin
Add the following to your config/bootstrap.php to load the plugin.
Plugin::load('Slince/Pjax', [ 'bootstrap' => true, ]);
Usage
The provided middleware provides the behaviour that the pjax plugin expects of the server:
Checks pjax request:
class PagesController { public function index() { debug($this->request->is('pjax')); //true } }
License
The MIT License (MIT). Please see License File for more information.