在用戶頁面上創建分頁時,分頁鏈接不正確,它們在/ page = 1之前,所以鏈接重定向到根目錄,404找不到。laravel 5中的分頁產生錯誤的鏈接
控制器的方法:
public function getRegister()
{
$users = User::where("admin", 0)->paginate(3);
return view('auth.register', compact('users'));
}
視圖
<?php echo $users->render(); ?>
用戶頁面網址:http://localhost:8080/pal/public/agent/create
分頁鏈接:http://localhost:8080/pal/public/agent/create/?page=1
當點擊分頁鏈接瀏覽器重定向我:http://localhost:8080/agent/create?page=3並獲得404頁面N OT FOUND
@ Carter.thank you.it幫我 – vision
@tester不用擔心。 – Carter