PHP code example of ajgarlag / psr-http-message-bundle
1. Go to this page and download the library: Download ajgarlag/psr-http-message-bundle 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/ */
ajgarlag / psr-http-message-bundle example snippets
namespace App\Controller;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ServerRequestInterface;
class DefaultController
{
public function index(ServerRequestInterface $request, ResponseFactoryInterface $responseFactory)
{
// Interact with the PSR-7 request
$response = $responseFactory->createResponse();
// Interact with the PSR-7 response
return $response;
}
}