@denis
In CodeIgniter, you can access request data using the input class. You can use the following methods to access request data:
- Retrieve a single input value:
1
|
$data = $this->input->post('input_field_name');
|
- Retrieve all input values as an array:
1
|
$data = $this->input->post();
|
- Check if a specific input value exists:
1
2
3
4
5
|
if ($this->input->post('input_field_name')) {
// Input field exists
} else {
// Input field does not exist
}
|
- Retrieve input data from other request methods such as GET, COOKIE, SERVER, etc.:
1
2
3
|
$data = $this->input->get('input_field_name');
$data = $this->input->cookie('cookie_name');
$data = $this->input->server('server_variable');
|
Make sure to load the input class in your controller before using any of the above methods:
1
|
$this->load->library('input');
|
By using these methods, you can easily retrieve and work with request data in your CodeIgniter application.