Welcome Guest, Not a member yet? Register   Sign In
variable subdirectory
#1

[eluser]Unknown[/eluser]
I didn't know how to make the title relevant so please read:

I have a "home" controller, and I want it to check the url for something like this
"index.php/home/variable", and then perform tasks based on the variable directory.

Is there a way to do this with codeigniter?
#2

[eluser]BrianDHall[/eluser]
Sure, use the URI Class Manual

Code:
$segs = $this->uri->segment_array();
var_dump($segs);

That will give you an idea of how that works, so in your constructor for instance you can check the segments for whatever you want and do whatever it is that you wanted to do.
#3

[eluser]Unknown[/eluser]
Thank you so much! It's much easier than I expected Smile
#4

[eluser]BrianDHall[/eluser]
You'll find you will say that a lot the more you use CI Smile




Theme © iAndrew 2016 - Forum software by © MyBB