PHP code example of gremo / pjax-bundle

1. Go to this page and download the library: Download gremo/pjax-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gremo / pjax-bundle example snippets



// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Gremo\PjaxBundle\GremoPjaxBundle(),
        // ...
    );
}



use Gremo\PjaxBundle\Annotation\Pjax;

/**
 * @Pjax(version="1.2")
 */
class DefaultController extends Controller
{
    // ...
}



use Gremo\PjaxBundle\Annotation\Pjax;

class DefaultController extends Controller
{
    /**
     * @Pjax(filter=false)
     */
    public function indexAction(Request $request)
    {
        // ...
    }
}



class DefaultController extends Controller
{
    /**
     * @Route("/", name="homepage")
     */
    public function indexAction(Request $request, $_isPjax, $_pjaxContainer)
    {
        if ($_isPjax) {
            // Return just the pjax container HTML if pjax is enabled
            // ...
        }

        // Return the full layout
        // ...
    }
}