Showing posts with label function. Show all posts
Showing posts with label function. Show all posts

Monday 28 March 2016

How to get Controller, Action/Function/Method, URL informations in CodeIgniter PHP

You could use the URI Class:
$this->uri->segment(n); // n=1 for controller, n=2 for method, etc
You can also use this in-built functions of codeigniter.
$this->router->fetch_class();
$this->router->fetch_method();