Final Class Yiisoft\Yii\Swagger\Action\SwaggerUi
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Psr\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| handle() | Yiisoft\ |
|
| withJsonUrl() | Yiisoft\ |
Method Details
| public mixed __construct ( \ | ||
| $viewRenderer | \ |
|
| $swaggerService | Yiisoft\ |
|
| $assetManager | \ |
|
| $params | array | |
public function __construct(
private readonly WebViewRenderer $viewRenderer,
private readonly SwaggerService $swaggerService,
private readonly AssetManager $assetManager,
private readonly array $params,
) {}
| public \ | ||
| $request | \ |
|
public function handle(ServerRequestInterface $request): ResponseInterface
{
$params = ArrayHelper::merge($this->defaultParams, $this->params);
$params['url'] = $this->jsonUrl;
return $this->viewRenderer
->withViewPath($this->swaggerService->getViewPath())
->renderPartial($this->swaggerService->getViewName(), [
'assetManager' => $this->assetManager,
'params' => $params,
]);
}
| public self withJsonUrl ( string $jsonUrl ) | ||
| $jsonUrl | string | |
public function withJsonUrl(string $jsonUrl): self
{
$new = clone $this;
$new->jsonUrl = $jsonUrl;
return $new;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.