-
-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Labels
type:bugBugBug
Description
Description
В параграфе про реализацию своего рендера, указан нерабочий пример.
На самом деле:
(1) В конструкторе требуются другие типы аргументов
(2) (3) этих функций не существует.
https://yiisoft.github.io/docs/guide/runtime/handling-errors.html#implementing-your-own-renderer
Как на самом деле у меня получилось организовать свой рендер.
config/common/di/error-handler.php
<?php
declare(strict_types=1);
use Yiisoft\ErrorHandler\RendererProvider\ContentTypeRendererProvider;
use Yiisoft\ErrorHandler\RendererProvider\RendererProviderInterface;
use Yiisoft\ErrorHandler\ThrowableResponseFactory;
use Yiisoft\ErrorHandler\ThrowableResponseFactoryInterface;
/**
* @var array $params
*/
return [
ThrowableResponseFactoryInterface::class => ThrowableResponseFactory::class,
RendererProviderInterface::class => [
'class' => ContentTypeRendererProvider::class,
'__construct()' => [
'renderers' => [
'*/*' => \App\Exceptions\CustomJsonRenderer::class,
],
],
],
];
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type:bugBugBug