rcrowe/turbo

Think turbolinks but for your PHP application. Powered by pjax.
3,455 87
Install
composer require rcrowe/turbo
Latest Version:0.3.0
PHP:>=5.3.0
License:MIT
Last Updated:Jun 21, 2014
Links: GitHub  ·  Packagist
Maintainer: rcrowe

Turbo

Turbolinks but for your PHP application; powered by PJAX.

Build Status

Installation

Turbo has only been tested installing through Composer.

Add rcrowe\turbo as a requirement to composer.json:

{
    "require": {
        "rcrowe/turbo": "0.2.*"
    }
}

Update your packages with composer update or install with composer install.

Providers

Providers enable instant usage of Turbo within different frameworks, we currently provide the following integrations:

Laravel

Add Turbo\Provider\Laravel\TurboServiceProvider to app/config/app.php and your good to go.

The Laravel provider also registers a turbo.pjax event so that other parts of your app can listen for a pjax request. For example:

Event::listen('turbo.pjax', function($request, $response) {
    $response->header('X-App-Msg', 'Hello world');
});

Fuelphp

Add class_alias('Turbo\\Provider\\Fuel\\Response', 'Response') to the bottom of fuel\app\bootstrap.php and your good to go.

Turbo also registers a turbo.pjax event that you can listen for. For example:

Event::register('turbo.pjax', function() {
    echo 'This is a pjax request';
});

PJAX

To make this all work Turbo needs PJAX to get and set the response. Just like Turbolinks we respond with the whole body, not just a section of it. In order to support this, you need to setup PJAX to use the <body> tag. A simple example of this would be:

$(function() {
    $(document).pjax('.js-pjax', 'body');
});

License

Turbo is released under the MIT public license.

Related Packages

jacobbennett/pjax

PJAX for Laravel 5

45,009 114
frenzy/turbolinks

Frenzy Turbolinks makes following links in your web application faster with Lara...

23,456 160
simonstamm/laravel-pjax

PJAX for Laravel 4 with redirection-support

8,286 22
spatie/laravel-pjax

A pjax middleware for Laravel 5

411,888 513
endeavors/pjax

Service Provider to set headers for a pjax request

14 0

Version History

Version Released PHP License
0.3.0 >=5.3.0 MIT
0.2.1 >=5.3.0 MIT
0.2.0 >=5.3.0 MIT
0.1.2 >=5.3.0 MIT
0.1.1 MIT