PHP code example of michaelbiberich / turbolinks-location-middleware

1. Go to this page and download the library: Download michaelbiberich/turbolinks-location-middleware 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/ */

    

michaelbiberich / turbolinks-location-middleware example snippets




ichaelBiberich\TurbolinksLocationMiddleware\TurbolinksLocationMiddleware;

$turbolinksLocation = new TurbolinksLocationMiddleware;

// ---
// Example: Slim 4 application middleware
// see: http://www.slimframework.com/docs/v4/concepts/middleware.html
// ---

use Slim\Factory\AppFactory;

$app = AppFactory::create();

// ...

$app->add($turbolinksLocation);

// ---
// Example: Mezzio middleware pipe
// see: https://docs.laminas.dev/laminas-stratigility/v3/middleware/
// ---

use Laminas\Stratigility\MiddlewarePipe;
use function Laminas\Stratigility\middleware;

$app = new MiddlewarePipe();

// ...

$app->pipe(middleware($turbolinksLocation));