PHP code example of webx / routes-session

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

    

webx / routes-session example snippets


use WebX\Routes\Session\Api\Session;

RoutesBootstrap::run([function(Routes $routes, Session $session, Response $response) {
    $count = ($session->data("count") ?: 0) + 1;
    $response->typeJson(["count"=>$count]);
    $session->setData("count",$count);
},"../vendor/webx/routes-session/config/routes"]);