$request->getPost() returns empty in Codeigniter 4

47 Views Asked by At

I have a form setup in codeigniter 4 with 2 routes.

$routes->get('/', 'Home::index');
$routes->post('/', 'Home::index');

But when I am retrieving the form values using the below code, it always returns empty array.

$this->request->getPost()
$request = \Config\Services::request();
var_dump($request->getPost()); die;

My form has multiple file attachments. When I try to retrieve the data, it always give empty array. Can anyone help me out to fix this issue?

enter image description here

0

There are 0 best solutions below