CodeIgniter Forums
uri segment problem - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: uri segment problem (/showthread.php?tid=51655)

uri segment problem - El Forum - 05-12-2012


i am having problem with using uri segment.

in my app, i want to execute a code when $this->uri->segment(1) has a value. and another code when it is not provided.

i have written the code, but the condition when segment(1) is not provided is never being satisfied, have tried all possibilities...

need your time and suggestions... in a hurry !!! Sad

uri segment problem - El Forum - 05-12-2012

If you take a look to you'll see that segment(1) is the controller name and segment(2) is the method name.

In a normal scenario segment(2) can be empty in which case it points to the controller's index() method and segment(1) when the controller is the default one (Default or set from config).