1. Go to this page and download the library: Download beauty-framework/core 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/ */
beauty-framework / core example snippets
use Beauty\Kernel\App;
Manager::bootFrom([
\App\Container\Base::class,
\App\Container\DI::class,
]);
$app = new App(
container: $container,
);
$app->handle($request);
use Beauty\Core\Router\Route;
class UserController
{
#[Route(method: \Beauty\Http\Enums\HttpMethodsEnum::GET, path: '/users')]
public function index(HttpRequest $request): \Psr\Http\Message\ResponseInterface
{
return new JsonResponse(200, [
'name' => $request->json('name'),
]);
}
}