PHP code example of chevere / schwager-html

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

    

chevere / schwager-html example snippets


composer 

use Chevere\Schwager\DocumentSchema;
use Chevere\Schwager\ServerSchema;
use Chevere\Schwager\Spec;
use Chevere\SchwagerHTML\Html;
use function Chevere\Router\router;

// Load your router
$routes = rverSchema(
    url: 'demoServerUrl',
    description: 'This is a sample server Petstore API spec.'
);
// Create spec
$spec = new Spec($router, $document, $testServer);
// Create html
$html = new Html($spec);
// Read html as string
$html->__toString();