PHP code example of ez-php / swagger-ui

1. Go to this page and download the library: Download ez-php/swagger-ui 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/ */

    

ez-php / swagger-ui example snippets


$app->register(\EzPhp\SwaggerUI\SwaggerUiServiceProvider::class);

return [
    'endpoint' => getenv('SWAGGER_UI_ENDPOINT') ?: '/docs',
    'spec_url' => getenv('SWAGGER_UI_SPEC_URL') ?: '/openapi.json',
    'renderer' => getenv('SWAGGER_UI_RENDERER') ?: 'swagger-ui', // or 'redoc'
];
bash
composer