设置全局变量
view()->share(‘request_uri‘, $request->getRequestUri());
View::share 的简易用法.
开启 app/Providers/AppServiceProvider.php
public function boot()
{
view()->share(‘copyright‘, ‘这是版权宣告.‘);
}
开启随便一个xxx.blade.php
{{$copyright}}
标签:col copy span get 设置 blog view 变量 provider
设置全局变量
view()->share(‘request_uri‘, $request->getRequestUri());
View::share 的简易用法.
开启 app/Providers/AppServiceProvider.php
public function boot()
{
view()->share(‘copyright‘, ‘这是版权宣告.‘);
}
开启随便一个xxx.blade.php
{{$copyright}}
标签:col copy span get 设置 blog view 变量 provider
原文地址:https://www.cnblogs.com/wanlibingfeng/p/8454797.html