如何使用PHP变量设置刀片表达式?

问题描述 投票:0回答:2
@section('title', {{exampleVariable}})

我怎样才能实现上述目标?

我一直在寻找答案,但没有发现任何相关内容。

laravel laravel-5 laravel-5.4 laravel-blade
2个回答
1
投票

只需使用:

@section('title', $exampleVariable)

代替。

{{只是用来显示变量,把它当作PHP echo方法,在这里你不想只是回显变量值


1
投票

你可以这样做:

@section('title', $exampleVariable)

或这个:

@section('title')
    {{ $exampleVariable }}
@endsection
© www.soinside.com 2019 - 2024. All rights reserved.