1. Go to this page and download the library: Download next/simple 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/ */
namespace App\Controllers;
use App\Http\Response;
use Next\Routing\Attribute\Controller;
use Next\Routing\Attribute\GetMapping;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
#[Controller(prefix: '/')]
class IndexController
{
#[GetMapping(path: '/')]
public function index(ServerRequestInterface $request): ResponseInterface
{
return Response::HTML('Hello, ' . $request->query('name', 'nextphp!'));
}
}