gpt4 book ai didi

php - laravel 如何读取 app/config/app.php 调试变量

转载 作者:IT王子 更新时间:2023-10-29 00:16:16 25 4
gpt4 key购买 nike

如何从我的 Controller 访问 app/config/app.php 中的调试变量以查看我是否处于 Debug模式?

<?php                                                                                                                
|
/* | if ( $this->user->id )
|-------------------------------------------------------------------------- | {
| Application Debug Mode | // Save roles. Handles updating.
|-------------------------------------------------------------------------- | $this->user->saveRoles(Input::get( 'roles' ));
| |
| When your application is in debug mode, detailed error messages with | // Redirect to the new user page
| stack traces will be shown on every error that occurs within your | return Redirect::to('admin/users/'.$this->user->id)->with('success', Lang::get('admin/users/messages.cre
| application. If disabled, a simple generic error page is shown. |ate.success'));
| | }
*/ | else
| {
'debug' => true,

最佳答案

您可以使用辅助函数配置(Laravel 5+)。

$debug = config('app.debug');

Laravel 4.2:

$debug = Config::get('app.debug');

关于php - laravel 如何读取 app/config/app.php 调试变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32189725/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com