execut / yii2-javascript-handler
Javascript error handler for Yii2
Installs: 194
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- execut/yii2-base: @dev
- yiisoft/yii2: >=2.0.13
README
Javascript error handler for Yii2
Install
Either run
$ php composer.phar require execut/yii2-javascript-handler "dev-master"
or add
"execut/yii2-javascript-handler": "dev-master"
to the require
section of your composer.json
file.
Configuration
Add module inside web application config:
return [ 'modules' => [ 'javascriptHandler' => [ 'class' => Module::class, ] ], ];
Render widget inside your application layout:
echo \execut\javascriptHandler\JavascriptHandlerWidget::widget([ 'clientOptions' => [ 'test' => true,// delete this line for stopping sending a test exception ], ]);
As a result, all javascript exceptions will throw php exceptions, that will be handled via yii2 error handler