php - 语法错误,意外的 '__data' (T_STRING),需要 ',' 或 ')' (查看:C:\xampp\htdocs\boxe\resources\views\utenteShow.blade.php)
问题描述
我需要解决这个问题,当我按下记录按钮时,程序应该把我带到刚刚注册的用户的页面上,但我得到这个错误:
错误:
语法错误,意外的 '__data' (T_STRING),需要 ',' 或 ')' (查看:C:\xampp\htdocs\boxe\resources\views\utenteShow.blade.php)
路线:
Route::post('/registrazione/store','RegistrazioniController@store')->name('registrazione.store');
Route::get('/registrazione/{utente}','RegistrazioniController@show')->name('utente.show');
控制器:
public function store(tabella_utenti $utente)
{
$this->validate (request(),[
'email' => 'required',
'password' => 'required',
'NomeUtente' => 'required'
]);
$utente=tabella_utenti::create(request(['email','password','NomeUtente']));
//comando che gli passa l'id
$utente=tabella_utenti::all();
$utenteId=$utente->id;
return redirect(route('utente.show',compact('utenteId')));
}
public function show(tabella_utenti $utente)
{
return view('utenteShow',compact('utente'));
}
看法:
@extends('layouts.layout)
@section('body')
<h1>Pagina Utente</h1>
@foreach($utente as $value)
Nome:{{$value->NomeUtente}}
@endforeach
@endsection
解决方案
您在视图的扩展参数中缺少结束引号。
它应该是@extends('layouts.layout')
推荐阅读
- signal-processing - LP 阶数和采样频率对语音共振峰的影响
- javascript - 反应功能自定义按钮未注册点击
- python - 在没有 CGI 的情况下将 html 表单值发布到 python 脚本
- nginx - Nginx 如何在不违反其他规则的情况下将标头应用于特定文件
- javascript - 由于不同的 url,cookie 不适用于 react 项目的两个不同 url
- python - 获取df中几个值的最小值和最大值
- windows - Windows批处理脚本或命令提示符有没有办法仅列出某个文件夹中的目录而不包括硬盘驱动器?
- python - 如何将数据添加到文件而不是重写?
- node.js - 通过Node js使用outlook smtp发送电子邮件
- python - Peewee:CompoundSelectQuery 必须绑定到数据库才能调用 exists()