1. Go to this page and download the library: Download anothy/slim-api-wrapper 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/ */
anothy / slim-api-wrapper example snippets
$container['slim-api-wrapper'] = function (\Slim\Container $c) {
return new \Anothy\SlimApiWrapper($c);
};
$app = new \Slim\App();
$app->get('/books', function ($request, $response, $args) {
// Show all books
})->setName('api-books');
$slimApiWrapper = $app->getContainer()->get('slim-api-wrapper');
$result = $slimApiWrapper->call('GET', 'api-books', [
'queryParams' => [
'page' => 1,
],
]);