Welcome Guest, Not a member yet? Register   Sign In
question about controller's contructure function
#1

[eluser]datactrl[/eluser]
HI, all

Is that possible on my controller's contructure function, to get information about which function is requestion on current request? Thank you!

Jack
#2

[eluser]jedd[/eluser]
Code:
echo $this->uri->segment(2);


?

Of course, you'll know which function has been called, cos you'll be *in* it.
#3

[eluser]datactrl[/eluser]
Thank you, jedd

jack
#4

[eluser]jedd[/eluser]
Was that the answer? That was easy! Smile

Note that if you start grouping your controllers into sub-directories, or start doing any funky routes etc .. this method won't work reliably for you anymore. I suspect you're probably not about to do that kind of stuff just yet, though.
#5

[eluser]datactrl[/eluser]
Thanks, Jedd. I noticed that. I do use subfolder to grouping controllers. So have to take care about which segment is the right one for the function name.




Theme © iAndrew 2016 - Forum software by © MyBB