21 lines
484 B
PHP
21 lines
484 B
PHP
|
<?php
|
||
|
|
||
|
/** @var yii\web\View $this */
|
||
|
|
||
|
$this->title = 'OpenAPI spec';
|
||
|
$this->registerJsFile('//unpkg.com/swagger-ui-dist/swagger-ui-bundle.js');
|
||
|
$this->registerCssFile('//unpkg.com/swagger-ui-dist/swagger-ui.css');
|
||
|
|
||
|
$loader = <<< JS
|
||
|
const ui = SwaggerUIBundle({
|
||
|
url: '/openapi.yml',
|
||
|
dom_id: '#swagger-ui'
|
||
|
});
|
||
|
JS;
|
||
|
$this->registerJs($loader, \yii\web\View::POS_END);
|
||
|
|
||
|
?>
|
||
|
|
||
|
<noscript>You need to enable JS to load Swagger UI</noscript>
|
||
|
<div id="swagger-ui"></div>
|