Laravel 5.1 指定当前页面以进行分页
已经为此工作了太长时间,没有结果。我试过了。
`\Illuminate\Pagination\Paginator::setCurrentPage($current_page);`
返回Call to protected method Illuminate\Pagination\Paginator::setCurrentPage()
\Paginator::setCurrentPage($current_page);
返回Call to protected method Illuminate\Pagination\Paginator::setCurrentPage()
\DB::getPaginator()->setCurrentPage($current_page);
返回call_user_func_array() expects parameter 1 to be a valid callback, class 'Illuminate\Database\MySqlConnection' does not have a method 'getPaginator'
$tmp = new Post( ); $tmp->getConnection()->setCurrentPage($current_page);
返回call_user_func_array() expects parameter 1 to be a valid callback, class 'Illuminate\Database\MySqlConnection' does not have a method 'getPaginator'
如何指定页面?我需要手动指定它。
我本来希望它像这样简单$model->find( )->paginate($per_page, $page)