下面是AppServiceProvider的Boot方法的代码
public function boot()
{
//
View::share('bbname','php_SERVER');
}
在视图中是无法解析出来的
ErrorException
Use of undefined constant bbname - assumed 'bbname' (this will throw an Error in a future version of PHP) (View: D:\Projects\php_project\notelog\resources\views\route\login.blade.php)
http://localhost:8000/u/login
解决方案
裂开,变量名没加 $ 符号,笑死。水了一篇文章