Welcome Guest, Not a member yet? Register   Sign In
question about uri->segment(n)
#1

[eluser]datactrl[/eluser]
Is that possible to find out whether uri->segment(1) or uri->segment(2)is the name of controller? I would like to get the name of the controller. But it is either in (1) or (2). How to know which one it is. Thank you in advance!


Jack
#2

[eluser]Kindari[/eluser]
If you just need the name of the currently executing controller, I believe you can access $this->router->fetch_class().


Furthermore, for directory and method, there is fetch_directory and fetch_method respectively.
the router class is automaticly loaded so no need to load it yourself.
#3

[eluser]skunkbad[/eluser]
How can the controller be #2? Wouldn't it always be #1?
#4

[eluser]datactrl[/eluser]
if controller is in sub-folder, the first one is the name of sub-folder. Yes, i just want the class name thank you so much!

Jack




Theme © iAndrew 2016 - Forum software by © MyBB