将此CSS添加到Codeigniter分页

时间:2015-03-01 00:08:08

标签: php css codeigniter

我正在尝试转换此HTML并将其实现为Codeigniter的分页。 我真的被卡住了。我无法弄清楚这一点。

HTML代码:(此代码基于css,它的工作原理完全正常。它就像一个分页模板)

<div class="pagination pagination-sample">
                        <!-- Minimal pagination variant -->
                        <a class="pagination__prev" href="#"><i class="fa fa-angle-left"></i></a>
                        <div class="pagination__block">
                            <a class="pagination__item" href="#">1</a>
                            <a class="pagination__item" href="#">2</a>
                            <a class="pagination__item mobile-small active-page" href="#">3</a>
                            <a class="pagination__item mobile-large" href="#">4</a>
                            <a class="pagination__item mobile-large" href="#">5</a>
                        </div>
                        <a class="pagination__next" href="#"><i class="fa fa-angle-right"></i></a>
                    </div>
    </div>

到目前为止我所拥有的:

  $uid = $this->session->userdata('uid'); //added on sat , feb 28

    $this->load->library('pagination');
    $this->load->library('table');

    $config['base_url'] = 'http://localhost/profile/entries';
    $config['total_rows'] = $this->db->get('entry')->num_rows();
    $this->db->where('uid', $uid);
    $this->db->order_by("time", "desc"); 
    $config['per_page'] = 10;
    $config['num_links'] = 20;

    $config['full_tag_open'] = '<div class="pagination pagination-sample">';
    $config['full_tag_close'] = '</div>';

    $config['next_tag_open'] = '<a class="pagination__next"><i class="fa fa-angle-right">';
    $config['next_tag_close'] = '</i></a>';

    $config['prev_tag_open'] = '<a class="pagination__prev"><i class="fa fa-angle-left">';
    $config['prev_tag_close'] = '</i></a>';

    $config['cur_tag_open'] = '<a class="pagination__item mobile-small active-page" ';
    $config['cur_tag_close'] = '</a>';
    $this->pagination->initialize($config);

    $data['records'] = $this->db->get('dayone_entries', $config['per_page'], $this->uri->segment(4));
    $this->pagination->create_links();

我的观看文件

    <?php include "includes/settings.php" ?>

<html>
    <body>
<div class="container">

        <h3 class="block-title block-title--simple"> Your <?php echo $site_title ?> Entries </h3>

<div class="devider-brand "></div>

         <?php echo $this->table->generate($records); ?>
        <?php echo $this->pagination->create_links(); ?>



        </div>

    </body>
</html>

1 个答案:

答案 0 :(得分:1)

要使用div,您需要使用for each而不是您正在使用的其他任何内容。