PHP code example of modufolio / appkit
1. Go to this page and download the library: Download modufolio/appkit 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/ */
modufolio / appkit example snippets
declare(strict_types=1);
namespace App\Controller;
use Modufolio\Appkit\Core\AbstractController;
use Modufolio\Psr7\Http\Response;
use Psr\Http\Message\ResponseInterface;
use Symfony\Component\Routing\Attribute\Route;
final class HelloController extends AbstractController
{
#[Route('/hello/{name}', methods: ['GET'])]
public function show(string $name): ResponseInterface
{
return Response::json(['message' => "Hello, {$name}"]);
}
}