Created
March 16, 2017 08:45
-
-
Save juneym/1f356f56f5a18a24023a1d2a88e5d54b to your computer and use it in GitHub Desktop.
Slim3 | passing request and response to an internal object instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use \Psr\Http\Message\ServerRequestInterface as Request; | |
use \Psr\Http\Message\ResponseInterface as Response; | |
require '../vendor/autoload.php'; | |
$app = new \Slim\App; | |
$app->get('/hello/{name}', function (Request $request, Response $response) { | |
$handleObj = new \My\Namespace\HelloHandler($request, $response); | |
return $handle->run(); | |
}); | |
$app->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment