Home > PHP Framework > YII > body text

yii2 close error prompt

angryTom
Release: 2019-11-06 16:45:21
Original
3884 people have browsed it

yii2 close error prompt

yii2 Close error prompt

In using Yii2, we found that once an error occurs in the program, Yii2 can Automatically displays its dedicated error prompt interface, which is completely different from the error prompt interface that appeared when we wrote the original ecology.

In fact, PHP has its own dedicated error handling API. When a problem occurs in the program, the specified function can be automatically called. Yii2 takes advantage of this. When it starts, it uses PHP's built-in set_error_handler to register its own error processing and turn off PHP's own error display.

Yii2 error registration mechanism

The following variables will control whether to enable error processing. The default is on. You can turn off the error log by setting the variable value

# \yii\BaseYii.php
/**
 * This constant defines whether error handling should be enabled. Defaults to true.
 */
 defined('YII_ENABLE_ERROR_HANDLER') or define('YII_ENABLE_ERROR_HANDLER', true);
Copy after login

Recommended: "YII Tutorial"

The above is the detailed content of yii2 close error prompt. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template