Welcome Guest, Not a member yet? Register   Sign In
Pagination Issue when I don't want to use uri->segment
#8

[eluser]CroNiX[/eluser]
You could create a helper function to determine what segment it is.

something like (untested):

Code:
function get_page_from_uri($search = 'page')
{
  $CI =& get_instance();
  $uri = split('/', $CI->uri->uri_string());
  $segment = null;
  foreach($uri as $k => $v)
  {
    if ($search == $v)
    {
      $segment = $k + 2; //segments start at 1, so add 2 to get segment after this one
      break;
    }
  }
  return $segment; //will be null if not present, or the segment number if found.
}

So if the url was: tasks/index/status/progress/page/4
Code:
$config['pagination']['uri_segment'] = get_page_from_uri(); //6


Messages In This Thread
Pagination Issue when I don't want to use uri->segment - by El Forum - 07-10-2014, 12:30 PM
Pagination Issue when I don't want to use uri->segment - by El Forum - 07-10-2014, 12:43 PM
Pagination Issue when I don't want to use uri->segment - by El Forum - 07-10-2014, 12:48 PM
Pagination Issue when I don't want to use uri->segment - by El Forum - 07-10-2014, 12:55 PM
Pagination Issue when I don't want to use uri->segment - by El Forum - 07-10-2014, 01:06 PM
Pagination Issue when I don't want to use uri->segment - by El Forum - 07-10-2014, 01:23 PM
Pagination Issue when I don't want to use uri->segment - by El Forum - 07-10-2014, 01:32 PM
Pagination Issue when I don't want to use uri->segment - by El Forum - 07-10-2014, 01:42 PM
Pagination Issue when I don't want to use uri->segment - by El Forum - 07-10-2014, 01:49 PM
Pagination Issue when I don't want to use uri->segment - by El Forum - 07-10-2014, 01:49 PM
Pagination Issue when I don't want to use uri->segment - by El Forum - 07-10-2014, 01:53 PM
Pagination Issue when I don't want to use uri->segment - by El Forum - 07-10-2014, 01:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB