1. Go to this page and download the library: Download nddcoder/rest 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/ */
class HomeController
{
public function __invoke(ServerRequestInterface $request)
{
$frameworkVersion = Application::VERSION;
return view('home.twig', compact('frameworkVersion'));
}
public function home()
{
return response()->redirect('/');
}
public function hello(ServerRequestInterface $request, $name)
{
return "Hello $name";
}
}