TP3.2框架分页相关实现方法分析

2020-06-03 15:00:14丽君

控制器中先继承后使用。

if($this->txt_keyword){
    $where['m_title'] = array('like','%'.$this->txt_keyword.'%');
}
 
$where['status'] = $param['status'] = 0;
$this->_select($this->information_mod,$where,'','*',0,10,'',$param);
$this->display();

模板中

<div class="hg_page" >
   {$page}
</div>

分页样式

<style>
 .hg_page .first, .hg_page .current, .hg_page .num, .hg_page .next, .hg_page .end, .hg_page .rows, .hg_page .prev{
  float: left;
  height: 37px;
  padding: 0 15px;
  border: 1px solid #e5e5e5;
  line-height: 37px;
  margin: 0 3px;
 }
 .hg_page{
  text-align: center;
  height: 37px;
  margin:0 auto;
  margin-top: 30px;
  margin-bottom: 20px;
  width: 800px;
 }
</style>

更多关于thinkPHP相关内容感兴趣的读者可查看本站专题:《ThinkPHP入门教程》、《thinkPHP模板操作技巧总结》、《ThinkPHP常用方法总结》、《codeigniter入门教程》、《CI(CodeIgniter)框架进阶教程》、《Zend FrameWork框架入门教程》及《PHP模板技术总结》。

希望本文所述对大家基于ThinkPHP框架的PHP程序设计有所帮助。

相关文章 大家在看