我已经使用codeigniter库创建了一个分页,但是当前页面的css没有显示正确的css。
PFB我的代码
public function news() {
$this->load->library('pagination');
$config['base_url'] = base_url('Home/news');
$config['total_rows'] = $this->db->get('web_news')->num_rows();
$config['per_page'] = 1;
$config['num_links'] = 1;
$config['uri_segment'] = 3;
$config['first_link'] = 'First';
$config['last_link'] = 'Last';
$config['next_link'] = 'Next';
$config['prev_link'] = 'Previous';
$config['full_tag_open'] = '<div class="text-center"><ul class="pagination"><li>';
$config['full_tag_close'] = '</li></ul></div>';
$config['cur_tag_open'] = '<div class="text-center"><ul class="pagination"><li class="active">';
$config['cur_tag_close'] = '</li></ul></div>';
$this->pagination->initialize($config);
$data['news'] = $this->ModelNews->newsData();
$data['newsCat'] = $this->ModelNews->newsCategory();
$data['newsRecentPost'] = $this->ModelNews->NewsRecentPost();
$data['pagination'] = $this->pagination->create_links();
$this->template->write_view('content', 'Web/news', $data, FALSE);
$this->template->load();
}
这是分页的结果,当前页码不在圆框上,我在库上设置当前标签的打开和关闭
我的HTML代码
<section class="container blog">
<div class="row">
<!-- Blog Column -->
<div class="col-md-8">
<h1 class="page-header sidebar-title">
KarAds Blog
</h1>
<!-- First Blog Post -->
<?php foreach($news as $arrNews): ?>
<div class="row blogu">
<div class="col-sm-4 col-md-4 ">
<div class="blog-thumb">
<a href="single-post.html">
<img class="img-responsive" src="<?php echo base_url('assets/files/news/'.$arrNews['image'])?>" alt="photo" width="250" height="172">
</a>
</div>
</div>
<div class="col-sm-8 col-md-8">
<h2 class="blog-title">
<a href="single-post.html"><?php echo $arrNews['title']; ?></a>
</h2>
<p><i class="fa fa-calendar-o"></i> <?php echo $arrNews['post_data']; ?>
<span class="comments-padding"></span>
</p>
<?php echo $arrNews['description']; ?>
</div>
</div>
<hr>
<?php endforeach; ?>
<?php echo $pagination; ?>