How to get controller method parameters in codeigniter?

Hari Gyan Vashisth

I have implemented a controller to give access of data of candidates.

class List_Controller extends CI_Controller {
     public function __construct()
     {
         parent::__construct();
         $data[]=array();

         /*
         Here I want to get value of $area parameter, to save into logs
        */
         $userId=$this->session->userdata('userId'); 
         // save logs 
         $this->UrlAccessHistory->save($this->router->class,$this->router->method,$userId,"Web Application");

     }

    public function fetchList($area=null){
        // fetch list of records from specified area 
    }
}

$this->router->className gives name of controller Class and $this->router->method gives name of of function called.

Please help to get the list of parameters at location (see comments in code) in the constructor, so that I can store it in the logs.

Sujit Agarwal

You could use the URI Class:

$this->uri->segment(n);

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to get a method called with different parameters?

Codeigniter how to get all/specific method in current controller

How to get the data from ajax in controller codeigniter

How to get values of method's parameters?

How to get rid of unused $_GET parameters in URL with Codeigniter?

How to set different routes for the same Controller method with different parameters?

How to get parameters from RequestBody in Spring REST controller method

How to get HttpServletRequest before controller method

How to assign parameters and different controller method to button_to in Rails?

How to pass these 2 parameters to controller action method?

How to Call Subfolder Controller method in Routes in CodeIgniter 4

How does codeigniter know how to pass parameters from controller to the model

how to get parameter value in codeigniter controller?

How to get parameters sent by ExtJs in a Zend controller?

How pass parameters between controller and view Codeigniter

How to get pending view controller from method?

In Rails, how to pass parameters to controller method from Jquery and then get returned values?

How to use parameters from the Url to use it in controller method?

how to set unknown parameters in get method

Codeigniter - Script execution slow - How to trace the right Controller and Method?

Sails.JS how to get a HTTP GET method in the controller to work properly with URL parameters

How to parse parameters using get method with Retrofit?

Codeigniter controller method 404 error

How to get parameter from Controller method in codeigniter?

How to pass two or more parameters to default controller of Codeigniter?

how to get base_url() in controller codeigniter

Set rules method parameters in CodeIgniter

Codeigniter 4 How to call a controller method in a view?

How to get the required parameters in a controller?