user3484506
user3484506

Reputation:

Codeigniter pagination create this prev and next links

I try to create pagination in CI

i have HTML

<!--div class="pagination">
<a href="#" class="page-prev">previous</a>
<ul>
    <li class="active"><a href="#">1</a></li>
    <li><a href="#">2</a></li>
    <li><a href="#">3</a></li>
    <li><a href="#">4</a></li>
</ul>
<a href="#" class="page-next">next</a>

in my controller i try this

        $config['full_tag_open'] = '<div class="pagination"><ul>';
        $config['full_tag_close'] = '</ul></div>';
        $config['cur_tag_open'] = '<li class="active">';
        $config['cur_tag_close'] = '</li>';
        $config['num_tag_open'] = '<li>';
        $config['num_tag_close'] = '</li>';
        $config['next_link'] = '';
        $config['prev_link'] = '<';
        $config['next_tag_open'] = '';
        $config['next_tag_close'] = '';
        $config['prev_tag_open'] = '';
        $config['prev_tag_close'] = '';

how i can put prev_link and next_link outside ul ? if my full tag open must be (if i`m not wrong) with tag ul

Upvotes: 0

Views: 1987

Answers (1)

user3484506
user3484506

Reputation:

$("div.pagination ul > a:last-child" ).addClass('page-next');
$("div.pagination ul > a:first-child" ).addClass('page-prev');

It helped me

Upvotes: 1

Related Questions