Thijs van Beek
Thijs van Beek

Reputation: 115

codeigniter variable segments

I'm having a problem with codeigniter segments.

Im looking for something like this where my controller is contacts and the action is list:

localhost/index.php/contacts/list/limit/10/offset/100/orderBy/postalCode/search/john/

This way I can mix my parameters up, they dont have to be in that specific order, or I can leave them out all together, for instance:

localhost/index.php/contacts/list/search/john/

How do I get this, because the way I see it, I can only request a segment like so:

$this->uri->segment(3);

But segment 3 can cary a offset value or a limit value, or something completely different.

Much appreciated

Upvotes: 0

Views: 212

Answers (1)

Yan Berk
Yan Berk

Reputation: 14428

Use $this->uri->uri_to_assoc() to get the parameters as explained here.

Upvotes: 3

Related Questions