Ahh, Pagination not displaying results :-( [SOLVED] |
[eluser]boltsabre[/eluser]
Oppps, sorry, I posted this in the wrong forum, and now it wont let me delete it (but I can edit it), my apologies people... Hi guys, really hoping someone can help me with a pagination issue, I'm baffled. So, I've got all the code in, it looks like it's working: - when the view is first loaded I see the correct number of results as set in my paginationConfig variable. - I see the pagination at the bottom, with the correct number of 'pages' - When I click on the another page my url is changing to reflect the 'offset' for the databse/ model call (see below). - But when I click on another 'page' I just see no results from my db - no error messages, just nothing... Original URl when view loads: - www.mydomain.com/visas/forum/general-topics New URl when pagination link is clicked: - www.mydomain.com/visas/forum/general-topics/10 If someone could look at my code and suggest where I have gone wrong I'd be extremely grateful, a million thanks in advance!!! Controller code: Code: function general_topics($postID = null){ The view code Code: <?php if($forum_results){ ?> And finally the model Code: // this limit and offset are set in the controller in the pagination config array, needed to make pagination work Any help would be great, I've been stuck on this for hours now!!!
[eluser]cideveloper[/eluser]
The problem you are having here is www.mydomain.com/visas/forum/general-topics/10 is passing $postID = 10 to general_topics thus running your else statement and pulling up visas/visa-forum-single-post-view You should not do it this way. Have one controller and if you must 2 functions. The first function pulls up the list with pagination, while the second pulls up each single post. I prefer to have 2 controllers. The first pulls up the list with pagination, while the second pulls up each single post.
[eluser]boltsabre[/eluser]
Ah yes, of course... sometimes I cannot see the forest through the trees! hehe. Thanks cideveloper, that's great!
[eluser]InsiteFX[/eluser]
If this issue has been Solved! Please udate your Post Title with [SOLVED] so that everyone knows Thank you InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |