PHP code example of ronanchilvers / container-bridge-slim
1. Go to this page and download the library: Download ronanchilvers/container-bridge-slim 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/ */
ronanchilvers / container-bridge-slim example snippets
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Ronanchilvers\Container\Slim\Container;
use Slim\App;
// Initialise a new container instance
$container = new Container();
// Pass the container instance into the app object's constructor
$app = new App($container);
$app->get('/', function (ServerRequestInterface $request, ResponseInterface $response) {
return $response->write('hallo');
});
$app->run();
use Ronanchilvers\Container\Slim\Container;
use Slim\App;
$container = new Container([
'settings' => [
'displayErrorDetails' => true,
]
]);
// Create the App object
$app = new App($container);