php - Laravel Compact 可变刀片文件显示语法错误
问题描述
这是我的控制器代码:
public function method(Request $request){
$typeType = $request->type; //this variable show 'Booking'
return view('home.profile',compact('type'));
}
这是刀片文件:
@extends('layouts.dashboard')
@section('page_heading',{{$taskType}})
@section('section')
//here some code
@stop
如果我使用这个刀片代码。然后我遇到了这个问题:
解析错误:语法错误,意外的“<”(查看:resources/view/home/profile.blade.php)
如果我在刀片上使用此代码
@extends('layouts.dashboard')
@section('page_heading','{{$taskType}}')
@section('section')
//here some code
@stop
然后刀片文件显示它:
<?php echo e($taskType); ?>
我想在刀片文件上显示它:
Booking
我怎么解决这个问题?
解决方案
可能您不需要{{ }}
刀片指令。
所以将其更改为:
@section('page_heading', $taskType)
推荐阅读
- python - Discord.py 发誓词过滤器
- unit-testing - 你应该对你的单元测试进行单元测试吗?
- numpy - 计算 numpy nd 数组中的非零向量
- swift - 如何使用用户默认值或 JavaScript 在 WKWebView 中自动填充表单
- python - 是否可以使用 discord.py 中的公会 ID 创建服务器的邀请链接
- flutter - 如何在颤动中从其 onTap() 函数更改列表图块的属性?
- python - Spyder 中的 Pylint 在 conda 环境中引发“E401 无法导入”
- javascript - 导航到下一页时如何正确清理打开的菜单
- r - 来自 R 中 QAP Logistic 回归的伪 R^2 度量(sna 包中的 netlogit)
- firebase - 使用模拟器而不是云进行 Firebase 云功能测试