如何在视图中显示控制器变量(blade)

How to display a controller variable in view(blade)

我在laravel 5.8中有一个控制器生成的变量,我想在视图上显示这个变量

我试过用常规的{!! $variable !!} 但它 returns

@section('page_heading',"System Dashboard | {!! $region !!}")

我希望得到 Kalipso Dashboard |Northern Region,但我却得到了 Kalipso Dashboard |

设置如下 假设 $region 的值 = 'Your custom string message here.';

@section('page_heading',"System Dashboard | {{ $region }}")

找到解决方案。 使用@section('page_heading',"System Dashboard | $region ")