CodeIgniter Forums

Full Version: Problem with segment-based uri for passing queries
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]nir1978[/eluser]
Hi

I am creating a site which has a table (pulled from the database) with pagination, sorting and search.

I have worked to get the pagination and by default uses the URI segment no. 3 for getting the pagination offset. that is fine (domain.com/controller/method/page/20)

I need to add sorting and search queries to the table. these work individually. but what I had noticed is the uri increases (domain.com/controller/method/page/20/sort/name/order/asc).

My problem is lets say I am doing the sorting and the uri is like above. what if one of the uri segment is removed. (sort/order/asc)when I am usin uri to assoc I will get [sort] => order, [asc] => ) which is actually wrong.

I was wondering if there is any code that would get me the right uri pairing even though the segments are missing. (I saw one application in symfony which does exactly what I am trying to get in CI.) delete the uri segment and still it works without throwing errors.

please help me