views:

746

answers:

1
+1  A: 

suppose url is: http://localhost/controller/method/

do following in your controller function

...
function method($page_num)
{
  ...
  $data['next_link'] = $page_num + 1;
  $data['prev_link'] = $page_num;
  ...
  $this->load->view('<veiw_name>', $data);

}

do this in your view

...
<a href="http://localhost/controller/method/&lt;?php echo $prev_link; ?>">Prev</a>
<a href="http://localhost/controller/method/&lt;?php echo $next_link; ?>">Next</a>
....
Codemaster Snake
@Codemaster Snake where the $page_num coming from ?
mehdi
I would assume it would be in the URL as variable segment.
mrinject