PHP code example of skansing / escapology

1. Go to this page and download the library: Download skansing/escapology 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/ */

    

skansing / escapology example snippets


    return [
      // Verb, Regex URI
      ['GET', '/'],
      ['GET', '/user/\d+'],
      ['POST', '/user/'],
      ['PUT', '/user/.+'],
      // ..
    ]

     $applicationRouter = new Skansing\Escapology\Router\Application(
      new RegexDispatcher($_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI']),
      null,
      new \Skansing\Escapology\Cacher\File,
      '_route_cache'
    );
    $routeFound = $applicationRouter->handle(
      __DIR__.'/route.php'
    );
    if($routeFound) {
      // or maybe you are already in the new applications frontcontroller and can go straight to dispatching