banki.test/views/open-api/index.php

21 lines
748 B
PHP
Raw Permalink Normal View History

2024-08-19 13:26:18 +02:00
<?php
/** @var yii\web\View $this */
$this->title = 'OpenAPI spec';
2024-08-20 09:03:06 +02:00
$this->registerJsFile('//unpkg.com/swagger-ui-dist@5.17.14/swagger-ui-bundle.js', [ 'crossorigin' => 'anonymous', 'integrity' => 'sha384-wmyclcVGX/WhUkdkATwhaK1X1JtiNrr2EoYJ+diV3vj4v6OC5yCeSu+yW13SYJep' ]);
$this->registerCssFile('//unpkg.com/swagger-ui-dist@5.17.14/swagger-ui.css', [ 'crossorigin' => 'anonymous', 'integrity' => 'sha384-wxLW6kwyHktdDGr6Pv1zgm/VGJh99lfUbzSn6HNHBENZlCN7W602k9VkGdxuFvPn' ]);
2024-08-19 13:26:18 +02:00
$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>