https://github.com/slince/cakephp-pjax
:pancakes: Pjax plugin for CakePHP
https://github.com/slince/cakephp-pjax
cakephp cakephp-pjax cakephp-plugin pjax pjax-middleware
Last synced: about 2 months ago
JSON representation
:pancakes: Pjax plugin for CakePHP
- Host: GitHub
- URL: https://github.com/slince/cakephp-pjax
- Owner: slince
- License: mit
- Created: 2017-12-28T10:11:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-29T05:45:52.000Z (over 7 years ago)
- Last Synced: 2025-04-14T09:53:20.594Z (about 2 months ago)
- Topics: cakephp, cakephp-pjax, cakephp-plugin, pjax, pjax-middleware
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Pjax plugin for CakePHP
[](https://travis-ci.org/slince/cakephp-pjax)
[](https://codecov.io/github/slince/cakephp-pjax)
[](https://packagist.org/packages/slince/cakephp-pjax)
[](https://scrutinizer-ci.com/g/slince/cakephp-pjax/?branch=master)This plugin for version 3 the CakePHP Framework. [Pjax](https://github.com/defunkt/jquery-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:
``` bash
$ composer require slince/cakephp-pjax
```## Load Plugin
Add the following to your config/bootstrap.php to load the plugin.
```php
Plugin::load('Slince/Pjax', [
'bootstrap' => true,
]);
```## Usage
The provided middleware provides [the behaviour that the pjax plugin expects of the server](https://github.com/defunkt/jquery-pjax#server-side):
Checks pjax request:
```php
class PagesController
{
public function index()
{
debug($this->request->is('pjax')); //true
}
}
```## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.