pagination not working - help |
[eluser]jcjc[/eluser]
Building a first pagination page on a blog I'm creating and it's not currently working, can anyone help? Code is: Code: $this->data['blog'] = $this->blog_model->_get_all_posts(); on the front I just have a blog foreach loop with <?php echo $pagination; ?> at the end. I get the 404 error page. thanks.
[eluser]CroNiX[/eluser]
try adding the method (it looks like you just have controller) in the base_url, and use segment 3 for uri_segment.
[eluser]CroNiX[/eluser]
Code: $config['base_url'] = base_url() . 'home/'; Code: $config['uri_segment'] = '2'; See the example in the user guide
[eluser]jcjc[/eluser]
got it - thanks, is there a way to remove controller and method from url structure?
[eluser]CroNiX[/eluser]
You can use routes to do that, although I'm not sure how you'd be able to remove the controller name unless you only have one controller in your entire app. How do you want the url to look? http://yoursite.com/30, where 30 is the pagination offset?
[eluser]jcjc[/eluser]
Managed to figure it out - the moment you said routes it clicked, have got it to = blog/page/2. Thanks for your help, glad to see the community is still behind this awesome framework. |
Welcome Guest, Not a member yet? Register Sign In |