PHP code example of xoops / frame

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

    

xoops / frame example snippets


$rack = new \Xoops\Frame\Rack();
$rack->add($someMiddleware);
$rack->add($anotherMiddleware);
$response = $rack->run($request);

$response = $rack($request);

$callable = function (RequestInterface $request, RequestHandlerInterface $handler) {
    $response = $handler->handle($request);
    $modifiedResponse = $response->withHeader('X-Powered-By', 'black coffee');
    return $modifiedResponse;
};
$middleware = new ClosureToMiddleware($callable);

$rack->add($middleware);

$response = $myResponseFactory->createResponse(200);
$rack->add(new FixedResponse($response));