All Projects → JacobBennett → pjax

JacobBennett / pjax

Licence: MIT license
PJAX for Laravel 5.*

Projects that are alternatives of or similar to pjax

Hexo-Theme-MengD
A simple, lightweight Hexo theme(支持:pjax、discuss、twikoo、waline、valine评论)
Stars: ✭ 69 (-40.52%)
Mutual labels:  pjax
typecho-theme-leaf
一款简洁又大气的typecho主题。演示站点
Stars: ✭ 62 (-46.55%)
Mutual labels:  pjax
laravel-grid
A grid view for laravel, inspired by the yii2 grid widget
Stars: ✭ 86 (-25.86%)
Mutual labels:  pjax

PJAX for Laravel 5.*

Latest Version on Packagist Total Downloads

Enable the use of PJAX in Laravel 5.*.

Installation

Add jacobbennett/pjax to require section in your composer.json

"jacobbennett/pjax": "~1.0"

Add 'JacobBennett\Pjax\PjaxMiddleware', to $middleware in app/Http/Kernel.php

How to use

This middleware will check, before outputting the http response, for the X-PJAX's header in the request. If found, it will crawl the response to return the requested element defined by X-PJAX-Container's header.

jQuery PJAX JS is required to use this package jquery.pjax.js.

See an example on Laracasts

Notes:

Sometimes when using PJAX it will timeout and trigger a standard page reload. This could be due to various factors but one thing you may try is to extend the default timeout for PJAX using this little snippet when you initialize PJAX.

$(document).ready(function(){

    // does current browser support PJAX
    if ($.support.pjax) {
    	$.pjax.defaults.timeout = 1000; // time in milliseconds
    }
    
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].