Skip to content

How to get Controller, Action name in CodeIgniter?

Last updated on December 2, 2022

Using the below methods you get controllers and action names in the CodeIgniter.

  $this->router->fetch_class(); // class = controller
  $this->router->fetch_method(); // action = method

You can access with below since the above methods are deprecated.

$this->router->directory;
$this->router->class;
$this->router->method;
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments