PHP code example of bjornbasar / karhu

1. Go to this page and download the library: Download bjornbasar/karhu 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/ */

    

bjornbasar / karhu example snippets


use Karhu\Attributes\Route;
use Karhu\Http\Response;

final class HomeController {
    #[Route('GET', '/hello/{name}')]
    public function hello(string $name): Response {
        return Response::json(['hello' => $name]);
    }
}