久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Laravel 5.1 指定當(dāng)前頁(yè)面進(jìn)行分頁(yè)

Laravel 5.1 specifing current page for pagination(Laravel 5.1 指定當(dāng)前頁(yè)面進(jìn)行分頁(yè))
本文介紹了Laravel 5.1 指定當(dāng)前頁(yè)面進(jìn)行分頁(yè)的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

為此工作了太久,但沒(méi)有結(jié)果.我試過(guò)了.

Been working on this for far too long with no results. I have tried.

`IlluminatePaginationPaginator::setCurrentPage($current_page);`

返回調(diào)用受保護(hù)的方法IlluminatePaginationPaginator::setCurrentPage()

Paginator::setCurrentPage($current_page);

返回調(diào)用受保護(hù)的方法IlluminatePaginationPaginator::setCurrentPage()

DB::getPaginator()->setCurrentPage($current_page);

返回 call_user_func_array() 期望參數(shù) 1 是一個(gè)有效的回調(diào),類 'IlluminateDatabaseMySqlConnection' 沒(méi)有方法 'getPaginator'

$tmp = new Post( );$tmp->getConnection()->setCurrentPage($current_page);

返回 call_user_func_array() 期望參數(shù) 1 是一個(gè)有效的回調(diào),類 'IlluminateDatabaseMySqlConnection' 沒(méi)有方法 'getPaginator'

如何指定頁(yè)面?我需要手動(dòng)指定.

How can I specify the page? I need to specify it manually.

我曾希望它像 $model->find()->paginate($per_page, $page)

推薦答案

假設(shè)你有 $users 在你的 UserController 中進(jìn)行分頁(yè),你可能會(huì)這樣做:

Suppose you have $users to paginate in your UserController, you might do:

public function index()
{
    $currentPage = 3; // You can set this to any page you want to paginate to

    // Make sure that you call the static method currentPageResolver()
    // before querying users
    Paginator::currentPageResolver(function () use ($currentPage) {
        return $currentPage;
    });

    $users = AppUser::paginate(5);

    return view('user.index', compact('users'));
}

我相信這適用于 Laravel 5.0 及更高版本.必須檢查一下.

I believe this applies to Laravel 5.0 and above. Have to check on that.

這篇關(guān)于Laravel 5.1 指定當(dāng)前頁(yè)面進(jìn)行分頁(yè)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Magento products by categories(按類別劃分的 Magento 產(chǎn)品)
Resource interpreted as image but transferred with MIME type text/html - Magento(資源被解釋為圖像但使用 MIME 類型 text/html 傳輸 - Magento)
Is there an event for customer account registration in Magento?(Magento 中是否有客戶帳戶注冊(cè)事件?)
Magento addFieldToFilter: Two fields, match as OR, not AND(Magento addFieldToFilter:兩個(gè)字段,匹配為 OR,而不是 AND)
quot;Error 404 Not Foundquot; in Magento Admin Login Page(“未找到錯(cuò)誤 404在 Magento 管理員登錄頁(yè)面)
Get Order Increment Id in Magento(在 Magento 中獲取訂單增量 ID)
主站蜘蛛池模板: 成人精品视频在线观看 | 狠狠狠干| 国产精品一区一区 | 欧美国产精品一区二区 | 男人的天堂久久 | 日韩精品一区二区三区在线播放 | 亚洲精品www | 日韩欧美视频免费在线观看 | 五月天婷婷丁香 | 国产福利在线小视频 | 亚洲日韩中文字幕一区 | 中文字幕一区在线观看视频 | 久久综合狠狠综合久久综合88 | 欧美福利在线 | 天天操夜夜艹 | 99九九久久 | 99久久99热这里只有精品 | 欧美激情国产日韩精品一区18 | 精品不卡| 俺去俺来也www色官网cms | 国产精品视频一区二区三区四蜜臂 | 午夜网 | 中文字幕在线第二页 | 成在线人视频免费视频 | 国产欧美视频一区二区 | www国产成人免费观看视频,深夜成人网 | 欧美日韩国产中文 | 国产精品69毛片高清亚洲 | 国产精品永久免费 | aaaaaaa片毛片免费观看 | 黄频视频 | 欧美日韩一 | 国产偷录视频叫床高潮对白 | 国产一区二区美女 | 国产欧美久久一区二区三区 | 欧美精品一区二区三区四区 在线 | 中文字幕免费观看 | 亚洲精品视频在线 | 免费久草 | 不卡一二区 | 成人三区四区 |