PHP code example of tyler / limon

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

    

tyler / limon example snippets


 // example basic index.php

on\App(
        new Limon\Kernel(
            new ActionResolver
        )
    );

    /** @var Psr\Http\Message\ServerRequestInterface $request */
    $request = captureServerRequest();

    // Reguster a handler, this can be replaced 
    // with middleware that sets the request-handler attribute
    // with a routing package
    $request = $request->withAttribute(
        'requst-handler', 
        fn(ServerRequestInterface $request) => new Response()
    );

    $res = $app->handle($request);

    Limon\emit($res);
})();
xml
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>