Support the ongoing development of Laravel.io →
posted 10 years ago
Configuration
Last updated 2 years ago.
0

I have used frenzyapp/turbolinks package in the past and it worked really well. Check it out, it’s basically the same as PJAX.

Last updated 2 years ago.
0

I tried it today and really easy to implement. Here is it https://github.com/vtalbot/pjax. And on the link where you want to call pjax you add this:

<a data-pjax="#page-wrapper" class="{{ Route::currentRouteName() =='getAdmin' ? 'active' : '' }}" href="{{ URL::route('getAdmin') }}"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>

So for example my content of route named getAdmin will be loaded in #page-wrapper div.

In your master view you add scripts

{{ HTML::script('js2/jquery.js'); }}
{{ HTML::script('js2/jquery.pjax.js'); }}

and

<script type="text/javascript">
        $(function() {
            $(document).pjax('a');
        });
</script>
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Panoplr panoplr Joined 27 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.