Welcome Guest, Not a member yet? Register   Sign In
Pagination Class Suggestion
#1

[eluser]Unknown[/eluser]
In my app, I enabled querystrings, but didn't want or need them for my search page. I was unable to override this setting and disable querystring pagination, so I modified lines 123 and 173 of the Pagination class so that I could accomplish this by setting
Code:
$config['page_query_string']
to
Code:
false
.

Both lines of code should look like this:
Code:
if (($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE) && $this->page_query_string !== false)

Thought I'd share, in case anyone else was running into the same issue.
#2

[eluser]topherdan1[/eluser]
Thanks for posting the code! This was the perfect solution to the problem I was running into. I would suggest that this be part of the core pagination code. I think a lot of people use enable_query_strings and still want url-friendly pagination
#3

[eluser]xwero[/eluser]
If you want mixed urls you better change the uri_protocol setting and fetch the GET global in the controller constructor or method using
Code:
parsestr($_SERVER['QUERY_STRING'],$_GET);

Enabling the query string is a hack to get mixed urls but it's a bad thing if you extend that hack to another library. In CI logic if you enable the query string you are going to use query string urls not mixed urls.




Theme © iAndrew 2016 - Forum software by © MyBB