我需要解决这个问题,当我按下record按钮时,程序应该将我带到刚刚注册的用户的页面,但我得到了这个错误:
错误:
语法错误,意外的'__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
发布于 2018-08-19 05:26:29
视图的扩展参数中缺少右引号。
应该是@extends('layouts.layout')
https://stackoverflow.com/questions/51912573
复制相似问题