PHP code example of fqapps / swoole-gin-framework
1. Go to this page and download the library: Download fqapps/swoole-gin-framework 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/ */
fqapps / swoole-gin-framework example snippets
declare(strict_types=1);
class HelloAction implements \SwooleGin\HandlerFuncInterface
{
public function __invoke(\Psr\Http\Message\ResponseInterface $rw, \Psr\Http\Message\RequestInterface $req)
{
$rw->withBody(new \SwooleGin\Stream\StringStream('Hello World'));
return $rw;
}
}