CodeIgniter Forums
how to get current class and method - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: how to get current class and method (/thread-69584.html)



how to get current class and method - Wong - 12-17-2017

Hi,

I use $this->router->class and $this->router->method to get name of class and method in CI3.
How to get name of class and method in CI4.

Thank you.


RE: how to get current class and method - kilishan - 12-17-2017

controllerName() and methodName() are the new methods.


RE: how to get current class and method - Wong - 12-17-2017

(12-17-2017, 09:39 PM)kilishan Wrote: controllerName() and methodName() are the new methods.

Thank you very much


RE: how to get current class and method - InsiteFX - 12-18-2017

@kilishan

Can we please get this added to the User Guide to save having to answer it again?

Thank you