Pagination over method parameters not working |
Hello CI Community,
i am having problem for the pagination over method parameters. My routes: PHP Code: $route['tag/(:any)'] = 'tag/index/$1'; The pagination works just perfect until i press the next page link! PHP Code: $pager['base_url'] = '/tag/'.$tagDetail->slug; Edit: If i add the method name in the pagination's base_url like this PHP Code: $pager['base_url'] = '/tag/index/'.$tagDetail->slug.'/'; Code: ... ORDER BY p.date DESC LIMIT people,20 Have a great day.
well you said that your pagination is working, but its not (pagination link's on supplied page are throwing 404 error). Post your controller code here so others can take a look and help, im a noob when it comes to routes..
The below part of documentation may help you fix this issue :
http://www.codeigniter.com/userguide3/in...aining-any Then, Did you initialize the pagination with $config["uri_segment"] = 3; parameter? (change the segment number according to the url)
@karthik_code Thanks for your reply. Here is my pagination setup:
PHP Code: //$pager['base_url'] = '/tag/index/'.$tagDetail->slug.'/';
I have checked your website.
Pages with people tag throws 'No photo' message on page number 4 and above. This is due to the following hard coded value in the above code. $pager['total_rows'] = 200; Dynamically count and set total rows like this. $pager['total_rows'] = $this->photo_model->count_by_tag($slug); (You may know this already because other pages programmed perfectly).
I have solved the problem using a custom hack... Thanks for mentioning counting total rows dynamically
|
Welcome Guest, Not a member yet? Register Sign In |