thinkphp分頁頁碼不顯示(資料足夠)

來源:互聯網
上載者:User
public function trends( ) {

$showtrends = M('Trends');

import('ORG.Util.Page');

$showscount = $showtrends->count();

$Page = new Page($trendscount,3);


$show = $Page->show();

$list = $showtrends->limit($Page->firstRow.','.$Page->listRows)->select();

$this->assign('trends',$list);

$this->assign('page',$show);

//dump($show);
//exit();

$this->display();
}

分頁效果能出來,但分頁頁碼不顯示,dump($show)資料為空白,這是怎麼回事呢


回複討論(解決方案)

你用的時TP幾點幾的系統?如果是新的那你的import就是無效的,因為最新的都採用了命名空間。

你用的時TP幾點幾的系統?如果是新的那你的import就是無效的,因為最新的都採用了命名空間。

我用的3.1的,可是在另一個控制器都能實現模糊分頁查詢,在這裡就不行了

另一個可以,這個卻不可以
顯然你有哪裡弄得不對!流程沒有問題的話,就是參數不對。還有就是模板是否對
使用 TP 提供的功能,只需按他的格式走,沒有什麼可調試的地方(傻瓜方式)

把這個 $Page = new Page($trendscount,3);
改成 $Page = new Page($showscount ,3);

把這個 $Page = new Page($trendscount,3);
改成 $Page = new Page($showscount ,3);

哦哦 對 變數搞錯了 謝謝哈
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.