Then I render it, and call my view $data['pagination'] = $pagination->render(); $this->template->content = View::forge('searchprofile/index', $data);
In my view I display my records and i added the pagination with
<?php echo $pagination ; ?>
The result is, that my records and the pagination appear correctly, but only on the view without pagination segment. If I click on link #1 then the url shows ...../controler# and the view does not change. If I click on link #2, the url shows ..../controler/2 but the content is error 404, that is the same for all following pages.
So it seems that I am doing exactly what the documentation is showing but can't get the links to have a normal behavior.
I tried what you said without success. My controller name is searchprofile and my method is action_index. I tried to display the usi segment with count(uri::segement), this is 1. So in my understanding the correct segment value is 2 right ?
In the Uri class, you see the segments passed to the controller, after resolving the controller. Pagination doesn't have a clue about controllers, it only deals with complete URI's.
'pagination_url' => \Fuel\Core\Uri::base(false).'searchprofile/index/page' gives no error 404 anymore but clicking on each page gives first page each time
Same with 'pagination_url' => \Fuel\Core\Uri::base(false).'searchprofile/index',
It was not the only thing to correct anyway. The pagination url needed to be that way : 'pagination_url' => \Fuel\Core\Uri::base(false).'searchprofile/index/page/', instead of 'pagination_url' => \Fuel\Core\Uri::base(false).'searchprofile',