I\'m trying to use pjax on my site, which means that for a full page request I render the whole template (this is normal behaviour), but on pjax requests I would like to ren
Why wouldn't you just replace the actual content in the rendered page using a div or html element?
I do this all the time with jQuery. I simply build my initial page and send content to my views that render sections in my master layout.
Let's say I had a left navigation column and then an article in the right column. The user clicks a button to display the next article, so that's what I want to replace.
First build the initial view from your controller
public function index()
{
$article = Article::first();
Return View::make('homepage', compact('article'));
}
Now in your homepage view
@extends('layouts.master')
@section('leftNavigation')
@include('homepageLeftNavigation')
@stop
@section('article')
@include('article')
@stop
@section('script')
@parent
{{--