Welcome Guest, Not a member yet? Register   Sign In
Generic Pagination Class
#3

[eluser]theprodigy[/eluser]
I added the ability to change the page link separator.
This is what is in between each numeric page link. It will not be between First, Prev, Next, or Last (unless you put it in yourself ;-) )

The variable name is $page_link_separator (for use in config array)
The public setter is set_page_link_separator( $link_sep )

The page link separator can be set to anything.
Commonly used are:
Code:
 
Code:
•
and combination of the two
Code:
 • 

The default is set to non-breaking space.

Since I have not yet provided an example of use, here are two examples (one using config array, and one using public setters)

Example 1 (config array):
Code:
// Load the library
$this->load->library('paginate');

// Setup config array
$config = array(
        'total_items' => 100,
        'items_per_page' => 20,
        'current_page' => 1,
        'page_link_separator' => '•'
    );

// Pass in config array to library
$this->paginate->configure($config);

// Get the pagination array
$this->data['pages'] = $this->paginate->get();

Example 2 (public setters) setting same items:
Code:
// Load the library
$this->load->library('paginate');

// Set the elements
$this->paginate->set_total_items(100);
$this->paginate->set_items_per_page(20);
$this->paginate->set_current_page(1);
$this->paginate->set_page_link_separator('•');

// Get the pagination array
$this->data['pages'] = $this->paginate->get();


Messages In This Thread
Generic Pagination Class - by El Forum - 04-12-2010, 07:19 PM
Generic Pagination Class - by El Forum - 04-14-2010, 06:15 AM
Generic Pagination Class - by El Forum - 04-27-2010, 03:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB