Nettuts CI Day 7 - Pagination Problem |
[eluser]domoench[/eluser]
Hi All, I'm working through the Nettuts Day 7 Tutorial, and the pagination links are not showing up when I load my view. My code is as follows: Controller: site.php Code: <?php View: site_view.php Code: <!DOCTYPE html> My Setup: - config.php: Set my base url- 'http://localhost/ci_day7/index.php' - database.php: Set my hostname, username, password, and database db variables. - autoload.php: loaded 'database' library, and 'url' helper Does anything above stick out as a reason why the <h1> would display in the view, but the $this->pagination->create_links() line does not?
[eluser]InsiteFX[/eluser]
Your missing the line below! Code: $config['uri_segment'] = 3; InsiteFX
[eluser]domoench[/eluser]
Thanks for the response Insite - I plugged in that line, but it had no effect. My controller now reads as follows: Code: <?php Any other problems visible? Thanks.
[eluser]DanTheMan[/eluser]
Hi domoench, This is probably something you have checked however; if you have not got more records in the database (in your case 10) then if I am correct it will not output any of the pagination links. It only outputs above your limit. Dan
[eluser]domoench[/eluser]
DanTheMan - That was it! I thought I had checked for that, but I recounted and I had created exactly 10 and no more. When I added a few more posts in my database the pagination links magically appeared. InsiteFX - Thanks for the link, looks very in-depth and slightly different in approach from the nettuts video I'm working through so I'm sure giving it a going over will help me solidify this stuff. Thanks all!
[eluser]DanTheMan[/eluser]
domoench, No problem! Im glad I could help. I have have to double check a couple of times in testing before thinking it wasn't working when it was. GL with the rest of your site. Dan |
Welcome Guest, Not a member yet? Register Sign In |