Skip to content

Commit

Permalink
Add debug toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz committed Jun 9, 2024
1 parent f91646e commit 1f0e27d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/common/di/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Yiisoft\Router\RouteCollection;
use Yiisoft\Router\RouteCollectionInterface;
use Yiisoft\Router\RouteCollectorInterface;
use Yiisoft\Yii\Debug\Viewer\Middleware\ToolbarMiddleware;

/** @var Config $config */

Expand All @@ -22,6 +23,11 @@
->routes(...$config->get('routes'))
);


if (!str_starts_with(getenv('YII_ENV') ?: '', 'prod')) {
$collector->prependMiddleware(ToolbarMiddleware::class);
}

return new RouteCollection($collector);
},
];

0 comments on commit 1f0e27d

Please sign in to comment.