CI分页类使用bootstrap样式
参考:http://codeigniter.org.cn/forums/thread-13504-1-1.html
首先在config目录新建pagination.php配置文件:
<?php $config['full_tag_open'] = '<div class="pagination"><ul>'; $config['full_tag_close'] = '</ul></div>'; $config['anchor_class'] = ""; $config['cur_tag_open'] = '<li class="active"><a>'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li>'; $config['num_tag_close'] = '</li>'; $config['prev_tag_open'] = '<li>'; $config['prev_tag_close'] = '</li>'; $config['next_tag_open'] = '<li>'; $config['next_tag_close'] = '</li>'; $config['first_link'] = '首页'; $config['first_tag_open'] = '<li>'; $config['first_tag_close'] = '</li>'; $config['last_link'] = '尾页'; $config['last_tag_open'] = '<li>'; $config['last_tag_close'] = '</li>'; $config['prev_link'] = '上一页'; $config['next_link'] = '下一页'; $config['use_page_numbers'] = TRUE; // url参数中显示的是页码
然后在autoload中开启自动加载pagination配置。