0
我想顯示一個頁面,當一個url被請求,但我得到的是一個空白頁面,儘管頁面中有內容的事實。我一直在試圖弄清楚我的代碼有什麼問題,但到目前爲止還沒有提出任何問題。下面是我在我的代碼Laravel 5請求的網址顯示空白頁面沒有錯誤
在我web.php文件,我有這個路線
Route::get('/home', '[email protected]')->name('home');
// Student
Route::get('/students', '[email protected]');
Route::get('/student/create', '[email protected]');
Route::post('/students', '[email protected]');
// Employee
Route::get('/employees', '[email protected]');
Route::get('/employee/create', '[email protected]');
Route::post('/employees', '[email protected]');
Route::get('/employee/{id}', '[email protected]');
// Faculty
Route::get('/faculty', '[email protected]');
在EmpController文件,這是顯示id爲員工(注意缺少的方法查詢我只是想試探看看,當請求此URI將顯示一個頁面)
public function show()
{
return view('emp.employee');
}
這是鏈接
<a href="/employee/{{ $employee->id }}" data-toggle="tooltip" title="View"><i class="fa fa-file-text-o" aria-hidden="true"></i></a>
這是我的資源/視圖/ EMP /文件夾
@extends('layouts.master')
@section('content')
<h3>Why is this page blank?</h3>
@endsection
錯誤報告設置爲true裏面employee.blade.php。我錯過了什麼?這應該很簡單
你不想在show功能中捕捉Id嗎? – Jagrati
檢查您的錯誤日誌,如果它顯示白頁,則必須有一些致命錯誤。並確保您已將環境設置爲.env文件中的應用程序 –
@ParthVora此錯誤來自日誌文件異常'Symfony \ Component \ Debug \ Exception \ FatalErrorException',並帶有消息'syntax error,unexpected'Route'(T_STRING )'在E:\ wamp64 \ www \ schoolAdmin \ routes \ web.php:39 **中,這些行是36到39行Route :: get('/ employee/{id}','EmpController @ show'); //師資 路線:: get('/ faculty','FacultyController @ index'); – Mena