PHP code example of rosengate / exedra

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

    

rosengate / exedra example snippets



use Exedra\Routing\Group;
use Exedra\Runtime\Context;
use Exedra\Application;

Group $group) {
    $group->middleware(function (Context $context) {
        return strtoupper($context->next($context));
    });

    $group['welcome']->get('/:name')->execute(function (Context $context) {
        return 'Hello ' . $context->param('name');
    });
});

$app->dispatch();

php -S localhost:9000