Skip to content
Easily support PJAX requests with FuelPHP
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

use Turbo

fuel-pjax is unsupported


Easily support PJAX requests with the same view in FuelPHP.

1) Install by placing the the code in fuel/packages/pjax

2) Add pjax to always_load -> packages in fuel/app/config/config.php


Wrap any section of your view with the {# PJAX #} tag so for example:

<div class="container">
  {# PJAX #}
  {# PJAX #}

Fuel will then return content if it is a PJAX request or remove the tag if not. If the <title> tag is found this is also returned to PJAX.

You can also use a seperate file for PJAX requests by appending -pjax to the file. So if you request home it will try and load home-pjax first. For example:

View::forge('home') -> home-pjax.php
Something went wrong with that request. Please try again.