Get current controller/method name in Codeigniter

/ Published in: PHP
Save to your folder(s)

this gives you the real controller/method names, even if you reroute them.

Copy this code and paste it in your HTML
  1. //current controller
  2. $this->router->class;
  4. //current method
  5. $this->router->method;

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.