Welcome Guest, Not a member yet? Register   Sign In
Pagination config file and ontime changes
#1

[eluser]Unknown[/eluser]
Hi all

I am trying to do something, but i don't know if it's possible.

The thing is that i want to have general pagination configuration stored in the pagination.php config file (i mean, open/close tags, per pages units, number of links on each side, etc... ) but i have to keep control on some other parameters, like base_url or total_rows. Maybe i didn't understand how it works, but the thing is that i have this code:
Code:
$pagination_config = array(
             'base_url'         => site_url() . '/home/show_category_grid/'.$uri_family.'/'. $uri_category. '/',
             'total_rows'     => $this->product->get_total_products_by_category($uri_family, $uri_category),
        'uri_segment'    => 5,
             'per_page'         => 9,
             'num_links'     => 10,
             'next_link'     => 'SIGUIENTES',
             'prev_link'     => 'ANTERIORES',
             'first_link'     => '<<',
             'last_link'     => '>>',
             'next_tag_open'    => '<span id="paginator_nav" class="gold">',
             'prev_tag_open' => '<span id="paginator_nav" class="gold">',
             'first_tag_open'=> '<span id="paginator_nav" class="gold">',
             'last_tag_open' => '<span id="paginator_nav" class="gold">',
             'next_tag_close'=> '</span>',
             'prev_tag_close'=> '</span>',
             'first_tag_close'=>'</span>',
             'last_tag_close'=> '</span>',
             );
$this->pagination->initialize($pagination_config);
which is actually working, but it is repeated in so many places. I've tried to store $pagination_config array into pagination.php config file, except base_url and so on, and it's not working.

My question is: do i have to call the config array $config?

How can i store all this fields:
Code:
'per_page'     => 9,
             'num_links'     => 10,
             'next_link'     => 'SIGUIENTES',
             'prev_link'     => 'ANTERIORES',
             'first_link'     => '<<',
             'last_link'     => '>>',
             'next_tag_open'    => '<span id="paginator_nav" class="gold">',
             'prev_tag_open' => '<span id="paginator_nav" class="gold">',
             'first_tag_open'=> '<span id="paginator_nav" class="gold">',
             'last_tag_open' => '<span id="paginator_nav" class="gold">',
             'next_tag_close'=> '</span>',
             'prev_tag_close'=> '</span>',
             'first_tag_close'=>'</span>',
             'last_tag_close'=> '</span>',
in a config file and change other fields on demand? Is it possible to do so?

Thank you all in advance!!!

CODEIGNITER RULEZ!!!!!!

Kaspar


Messages In This Thread
Pagination config file and ontime changes - by El Forum - 07-20-2010, 01:29 PM
Pagination config file and ontime changes - by El Forum - 07-20-2010, 06:37 PM
Pagination config file and ontime changes - by El Forum - 07-20-2010, 06:45 PM
Pagination config file and ontime changes - by El Forum - 07-24-2010, 11:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB