codeigniter中的bootstrap分页工作,但设计beome搞砸了

时间:2015-04-28 22:21:46

标签: twitter-bootstrap codeigniter

我的pagination.php文件

Form.Load()

和我的观看文件

$config['full_tag_open'] = "<ul class='pagination'>";
$config['full_tag_close'] ="</ul>";
$config['num_tag_open'] = '<li>';
$config['num_tag_close'] = '</li>';
$config['cur_tag_open'] = "<li class='disabled'><li class='active'><a href='#'>";
$config['cur_tag_close'] = "<span class='sr-only'></span></a></li>";
$config['next_tag_open'] = "<li>";
$config['next_tagl_close'] = "</li>";
$config['prev_tag_open'] = "<li>";
$config['prev_tagl_close'] = "</li>";
$config['first_tag_open'] = "<li>";
$config['first_tagl_close'] = "</li>";
$config['last_tag_open'] = "<li>";
$config['last_tagl_close'] = "</li>";

控制器

<nav> 
  <ul class="pagination">
    <li>
      <a href="#">
         <?php echo $this->pagination->create_links(); ?>
      </a>
    </li> 
  </ul>
  </nav>

它给了分页,但设计搞砸了。第1页&amp; 2&amp; 3在这里和那里我该如何纠正它?我也想制作最后一页&amp;第一页,但我没有一个好主意。

2 个答案:

答案 0 :(得分:1)

修复您的配置

    $config['full_tag_open'] = "<ul class='pagination'>";
    $config['full_tag_close'] ="</ul>";

    $config['num_tag_open'] = '<li>';
    $config['num_tag_close'] = '</li>';

    $config['cur_tag_open'] = "<li class='disabled active'><a href='#'>";//you added extra li tag here
    $config['cur_tag_close'] = "<span class='sr-only'></span></a></li>";

    $config['next_tag_open'] = "<li>";
    $config['next_tag_close'] = "</li>";//tagl? should be tag

    $config['prev_tag_open'] = "<li>";
    $config['prev_tag_close'] = "</li>";//tagl? should be tag

    $config['first_tag_open'] = "<li>";
    $config['first_tag_close'] = "</li>";//tagl? should be tag

    $config['last_tag_open'] = "<li>";
    $config['last_tag_close'] = "</li>";//tagl? should be tag

在您的视图中使用此代码

<nav> 
     <?php echo $this->pagination->create_links(); ?>
</nav>

答案 1 :(得分:0)

尝试改变:

$config['cur_tag_open'] = "<li class='disabled active'><a href='#'>";
$config['cur_tag_close'] = "<span class='sr-only'></span></a></li>";

$config['cur_tag_open'] = "<li class='disabled active'><a href='#'><span class='sr-only'>";
$config['cur_tag_close'] = "</span></a></li>";