Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 3 fetch_method() equivalent in CI4
#1

Is there an equivalent method to get the method that was called in the current controller class that CI3 had that was called fetch_method()? The docs are a bit overwhelming right now because I'm not used to a lot of this stuff that's included in this framework. I used get_class() to get the class but I haven't found the easy way to get the method just yet. I'm still searching the docs but I know it has to be somewhere.

Thanks forĀ  your time
Reply
#2

PHP Code:
$router = \Config\Services::router();
$method $router->methodName(); 
Reply
#3

(This post was last modified: 03-19-2022, 07:25 PM by ChicagoPhil.)

I found the method in the Router Class. It's called methodName() now. Of course I got the idea where to find it right after I posted the question.

(03-19-2022, 07:24 PM)kenjis Wrote:
PHP Code:
$router = \Config\Services::router();
$method $router->methodName(); 

You're quick! Thank You!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB