Pagination current URL. |
[eluser]sahanlak[/eluser]
This is the config code for the pagination. Code: $this->load->library('pagination'); $ID is an integer. The problem is pagination wont select the current page, its always selecting the number 1. Why is that?
[eluser]Thomas Edwards[/eluser]
You need this: Code: $config['uri_segment'] = 3; Code: $config['base_url']="http://domain.net/index.php/admin/partner/"; Pagination Class
[eluser]sahanlak[/eluser]
Actually after page get viewed in the browser, the base url is like this. http://domain.net/index.php/admin/partner/1/ So with paginated http://domain.net/index.php/admin/partner/1/2
[eluser]sahanlak[/eluser]
It dsnt work, even if I set it correctly in $config['uri_segment'] its capturing the "1" in here http://domain.net/index.php/admin/partner/1/2 but it has to be 2 the last number of the url.
[eluser]Thomas Edwards[/eluser]
Like I said, you need to take the variable out of the base_url. Code: $this->load->library('pagination');
[eluser]Thomas Edwards[/eluser]
Here’s a page: http://www.unionplus.co.uk/test/pages/ Here’s the code: Code: function pages()
[eluser]sahanlak[/eluser]
Yea that works, but I think the pagination get confuced with my url structure. http://domain.net/index.php/admin/partner/1/2/ lets take number 1 and 2, number one is an input var that I pass to the partner method in admin controller; 2 is the number for pagination but for some reason even if I specify $config['uri_segment'] = 4; it keeps getting the 1 instead of 2. Hope it make sense.
[eluser]sahanlak[/eluser]
For your example its not necessary to specify $config[‘uri_segment’] I think |
Welcome Guest, Not a member yet? Register Sign In |