教程集 www.jiaochengji.com
教程集 >  脚本编程  >  php  >  正文 Call to undefined method DebugBar\\DebugBar::info()

Call to undefined method DebugBar\\DebugBar::info()

发布时间:2017-12-11   编辑:jiaochengji.com
教程集为您提供Call to undefined method DebugBar\\DebugBar::info()等资源,欢迎您收藏本站,我们将为您提供最新的Call to undefined method DebugBar\\DebugBar::info()资源
我们看到英文Call to undefined method就知道是因为函数或方法没有定义了,这个对于插件就有可能是什么功能没有开启了,我们下面来看看Call to undefined method DebugBar\\DebugBar::info()问题解决方法

使用 Laravel 的调试工具 laravel-debugbar 的 Facade 方式 Debugbar::info(), Debugbar::error()等方法打印日志消息,页面打不开,查看 PHP 错误日志报错:Call to undefined method DebugBar\\DebugBar::info().

请确保按照https://github.com/barryvdh/laravel-debugbar上的文档安装的,别忘了执行 composer dump-autoload.

如果你找不到原因,可能是命名空间引用错了,改成


use Barryvdh\Debugbar\Facade as Debugbar;

再用 Facade 的方式调用:

Debugbar::info('test debug info');

这个时候发现可以了,如图:

不过这样使用有点不方便了,这个组件的 Facade 的定义方式有点奇怪,不应该这样去定义,先就这样用吧,或者自己定义一个全局函数,直接通过 app(‘debugbar’) 这种方式去调用。吧。

您可能感兴趣的文章:
Call to undefined method DebugBar\\DebugBar::info()
Laravel 调试工具 laravel-debugbar 打印日志消息
Laravel调试利器Laravel Debugbar使用教程
解决Magento报错:Fatal error: Call to undefined method
Laravel 调试工具 laravel-debugbar使用介绍
Call to undefined function curl_init的解决办法
PHP spl_autoload_register 自动加载方法浅析
php Fatal error: Call to undefined function mb_convert_encoding()
jQuery ajax BUG:object doesn't support this property or method
Fatal error: Call to undefined function curl_init

[关闭]
~ ~