如何在CakePHP 3中打开调试模式?

时间:2018-01-11 18:46:15

标签: cakephp cakephp-3.0

我在 app.php 中将$debug设置为true,但没有任何变化。

如何在CakePHP中启用调试模式?

1 个答案:

答案 0 :(得分:0)

根据cookbook,您可以通过更改" debug"的值来启用或禁用调试模式。 config / app.php文件中的参数。

/**
 * Debug Level:
 *
 * Production Mode:
 * false: No error messages, errors, or warnings shown.
 *
 * Development Mode:
 * true: Errors and warnings shown.
 */
'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN),

在您的控制器中,您可以使用log() method进行记录(对所有对象都可用):

$this->log('debug message','debug');
相关问题