PHP code example of chubbyphp / chubbyphp-framework-router-sunrise
1. Go to this page and download the library: Download chubbyphp/chubbyphp-framework-router-sunrise 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/ */
chubbyphp / chubbyphp-framework-router-sunrise example snippets
declare(strict_types=1);
namespace App;
use Chubbyphp\Framework\Application;
use Chubbyphp\Framework\Middleware\ExceptionMiddleware;
use Chubbyphp\Framework\Middleware\RouterMiddleware;
use Chubbyphp\Framework\RequestHandler\CallbackRequestHandler;
use Chubbyphp\Framework\Router\Sunrise\Router;
use Chubbyphp\Framework\Router\Route;
use Psr\Http\Message\ServerRequestInterface;
use Slim\Psr7\Factory\ResponseFactory;
use Slim\Psr7\Factory\ServerRequestFactory;
$loader = y()->write(sprintf('Hello, %s', $name));
return $response;
}
))
])),
]);
$app->emit($app->handle((new ServerRequestFactory())->createFromGlobals()));