views:

372

answers:

1

Hi everybody, I am browsing trough the CI documentation particularly http://codeigniter.com/user_guide/libraries/pagination.html .

First thing that was stuck in my mind was "CodeIgniter's Pagination class is very easy to use, and it is 100% customizable, either dynamically or via stored preferences." but there always but something.

My pagination is as following Previous 1 2 3 4 ... n Next now for each of these I can create opening html tags and closing html tags in my controller.

For ex:

Previous

$config['prev_tag_open'] = '<div class="previous">';

The opening tag for the "previous" link.
$config['prev_tag_close'] = '</div>';

Next

$config['next_tag_open'] = '<div>';

The opening tag for the "next" link.
$config['next_tag_close'] = '</div>';

And for Last first etc. Now in my design I made Previous float left Next float right and I have a <div class="middle_pager"> which holds all page numbers together in the middle.

From what I see in the documentation I don't have a option in CI to put all page numbers in between html tags, I only have option to put each page number inside some tags, maybe there is a way but I missed a point. Anybody can help?

Thank you

+1  A: 

The trick is, that you have to think out of the box.

You should add a an opening tag to the end of of your "prev_tag_close"

$config['prev_tag_open'] = '<div class="previous">';

The opening tag for the "previous" link.
$config['prev_tag_close'] = '</div>**<opening tag>**';

and a closing tag at your "next_tag_open" like

$config['next_tag_open'] = '**</opening tag>**<div>';

The opening tag for the "next" link.
$config['next_tag_close'] = '</div>';

that should do the trick.

Adnan
hmmm yes indeed its super awesome. thank you
c0mrade