CodeIgniter Forums
how to get method name from controller ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: how to get method name from controller ? (/showthread.php?tid=5949)



how to get method name from controller ? - El Forum - 02-09-2008

[eluser]Anton111[/eluser]
I'm trying a new version ;-)
But in old version i used the following code:
Code:
$this->_method = $this->uri->router->fetch_method();
        $this->_class = $this->uri->router->fetch_class();
        $this->_directory = $this->uri->router->fetch_directory();

in the new version this code doesn't work. How can i get class, method and directory name from controller in the new version?


how to get method name from controller ? - El Forum - 02-09-2008

[eluser]tonanbarbarian[/eluser]
the router is now no longer in the uri class
instead you need to do something like
Code:
$RTR =& load_class('Router');
$RTR->fetch_method();



how to get method name from controller ? - El Forum - 02-10-2008

[eluser]Anton111[/eluser]
Oh tnx. it help me.