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.
You can install the package via composer:
$ composer require slince/cakephp-pjax
Add the following to your config/bootstrap.php to load the plugin.
Plugin::load('Slince/Pjax', [
'bootstrap' => true,
]);
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
}
}
The MIT License (MIT). Please see License File for more information.