tp5分頁,一看就懂,簡單明了(附帶額外參數)


php 代碼:

$result = $jjModel->where($wheres)->paginate(10,false,['query' => ['peytype'=>$peytypes]]); (查詢10條數據,get參數'paytype',根據自己情況來)

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

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

return $this->view->fetch();

 

html代碼:

{volist name="list" id="v"}
  <tr class="td_type_content">
    <td align="left">{$v['peytype']}</td>
    <td align="center" style="color:#05ff98">+{$v['coin']}</td>
    <td id="td_type_content_btn" align="right">{$v['idate']}</td>
  </tr>
{/volist}
<div id="footerss">
{$page}
</div>

簡直不要太簡單。。。。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM