1. Go to this page and download the library: Download diogodg/neoframework 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/ */
diogodg / neoframework example snippets
#[RoutePrefix('/api/users')]
#[Middleware(ApiAuthentication::class)]
final class UserController extends Controller
{
#[Route('/{id:\\d+}', ['GET'], name: 'users.show')]
public function show(int $id): Response
{
return $this->json(['id' => $id]);
}
}
final class ApiAuthentication implements MiddlewareInterface
{
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
return $handler->handle($request)->withHeader('X-Authenticated', '1');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.