标签: cakephp-3.6

如何判断 CakePHP 3.x 中的调试模式是否开启

我想知道如何检索 env() 函数中的 var ......

/**
 * 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),
Run Code Online (Sandbox Code Playgroud)

现在我正在使用

<?php if(DEBUG == true) { ?>
Run Code Online (Sandbox Code Playgroud)

但这会引发错误

Use of undefined constant DEBUG - assumed 'DEBUG' (this will throw an Error in a future version of PHP)
Run Code Online (Sandbox Code Playgroud)

php cakephp cakephp-3.0 cakephp-3.6

2
推荐指数
1
解决办法
1293
查看次数

标签 统计

cakephp ×1

cakephp-3.0 ×1

cakephp-3.6 ×1

php ×1