dev-master
9999999-devYii2 bindings for Whoops error handler
MIT
The Requires
- php >=5.6.0
- yiisoft/yii2 ^2.0
- filp/whoops ^2.1
The Development Requires
by Thijs Zumbrink
Yii2 bindings for Whoops error handler
This library provides easy integration of filp/whoops into Yii2. Whoops is a pretty exception and error formatter. This library enables you to use it by configuring an ErrorHandler in your application config., (*1)
Configure web.php
to disable Yii's built-in error handler and use the new one:, (*2)
<?php $config = [ // ... 'components' => [ 'errorHandler' => [ 'class' => 'lucidtaz\yii2whoops\ErrorHandler', // NOTE: yii2-app-basic comes with this errorAction line by default, // be sure to comment/remove it, or you will get an // UnknownAttributeException when running your code: // 'errorAction' => 'site/error' ], // ... ], // ... ];
Or to only use it in Dev+Debug mode, to prevent your source code displaying in production:, (*3)
<?php $config = [ // ... 'components' => [ 'errorHandler' => YII_ENV_DEV && YII_DEBUG ? [ 'class' => 'lucidtaz\yii2whoops\ErrorHandler', ] : [ 'class' => 'yii\web\ErrorHandler', 'errorAction' => 'site/error' ], // ... ], // ... ];
Yii2 bindings for Whoops error handler
MIT