CodeIgniter Forums
Find Out Controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Find Out Controller (/showthread.php?tid=50330)



Find Out Controller - El Forum - 03-22-2012

[eluser]Freewolf[/eluser]
Hopefully this question will make sense.

Calling $this->uri->segement(n);
Gives me a listing of a particular segment in the url.

However I am looking to be able to discover what controllers I am currently viewing under.

I have a particular controller (programs)
However in the URI programs is not listed at all.
I am using rewriting of the uri here.

But I want to know if I am under the programs controller, or if I am viewing a different controller on the site.

In the debugging profiler I see class/method listed.
So I assume it is possible.

Any suggestions?

Blessed Be

Phillip


Find Out Controller - El Forum - 03-22-2012

[eluser]CroNiX[/eluser]
Code:
echo $this->router->fetch_directory();  //current directory executed class is in
echo $this->router->fetch_class();            //current class
echo $this->router->fetch_method();           //current method



Find Out Controller - El Forum - 03-22-2012

[eluser]Freewolf[/eluser]
Thanks