PHP code example of nih / app-skeleton

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

    

nih / app-skeleton example snippets


$app->routes->path('/about')
    ->action('', App\Action\AboutAction::class, '__invoke', ['GET']);

$app->pipeline->prepend(App\Http\Middleware\RequestIdMiddleware::class);

use NIH\Router\Strategy\PathToClassStrategy;

$app->routes->path('/forums/')
    ->strategy(PathToClassStrategy::class, [
        'namespace' => 'App\\Action\\Forums',
    ]);