Pagination Problem |
[eluser]Lazos[/eluser]
I have this code inside my controller. In my CONFIG file I have $config['enable_query_strings'] = TRUE; Even I write $config['page_query_string'] = TRUE or FALSE still at the end of the link I am getting /index.php/admin/adminlog/&per_page=20 which is wrong I thing. How to fix it to get links like this /index.php/admin/adminlog/page/20 I can not change the one of the config file because most of my inks pass parameters like this adminlog?param=1 Code: $config['per_page'] = '20';
[eluser]fesweb[/eluser]
Do you have query strings enabled in your CI config (config/config.php)? If so, then it doesn't matter what you set in the pagination config, it will give you a query string. The solution I went with was to copy the pagination library into my application's libraries (libraries/Pagination.php) and edit the two places which check for query strings. Code: // change this
[eluser]domcat[/eluser]
[quote author="fesweb" date="1228169042"]Do you have query strings enabled in your CI config (config/config.php)? If so, then it doesn't matter what you set in the pagination config, it will give you a query string. The solution I went with was to copy the pagination library into my application's libraries (libraries/Pagination.php) and edit the two places which check for query strings. Code: // change this
[eluser]domcat[/eluser]
Actually, this did work for me. Forgot to set page_query_string to FALSE.
[eluser]JoostV[/eluser]
You might like the automated pagination lib I wrote for CI> You can find it here: http://ellislab.com/forums/viewthread/86428/ Basically, once you load the library you have instant pagination. It just assumes that you use the following naming convention for paging: Page/offset. You need to have this somewhere (anywhere) in your URI. You dont need QUERY_STRING to use this lib.
[eluser]learnq[/eluser]
I have the same problem . I fix it as said befor Code: $CI->config->item('enable_query_strings') === TRUE AND $this->page_query_string === TRUE but it cannot determine the current page number. ie, if I click page 2 it shows the content of page 2 but the link shows that it is page 1 . in my config.php Code: $config['uri_protocol'] = "AUTO"; I need to use both url sigment and query string. Any help appreciated.
[eluser]learnq[/eluser]
solved , Code: $config['uri_segment'] |
Welcome Guest, Not a member yet? Register Sign In |