![]() |
Form with POST return null - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Form with POST return null (/showthread.php?tid=72219) |
Form with POST return null - Perhood - 11-23-2018 Hi , I have a form with methop post it send the data from the form when put input, but when I do the $request->getPost('idiomas') it returns a null. I have tried with method get and it works but I need to do it in post. This what the headers infow show me ![]() This is how I create the route PHP Code: $routes->post('{locale}/app/admin/edit', 'Editor::edit', ['namespace' => 'App\Controllers\Appmudet\Admin']); And this is the form in html Code: <form action="/es/app/admin/edit" method="post"> This is the edit function PHP Code: public function edit(){ RE: Form with POST return null - InsiteFX - 11-23-2018 Did you try using a matched route? PHP Code: $routes->match(['get', 'post'], '{locale}/app/admin/edit', 'Editor::edit', ['namespace' => 'App\Controllers\Appmudet\Admin']); RE: Form with POST return null - Perhood - 11-26-2018 (11-23-2018, 09:12 AM)InsiteFX Wrote: Did you try using a matched route? Yes I have tried it, and the var_dump still show me a NULL RE: Form with POST return null - NiteRaven - 11-26-2018 https://codeigniter4.github.io/CodeIgniter4/incoming/routing.html#placeholders ! Note: {locale} cannot be used as a placeholder or other part of the route, as it is reserved for use in localization. RE: Form with POST return null - Perhood - 11-27-2018 (11-26-2018, 08:11 PM)NiteRaven Wrote: https://codeigniter4.github.io/CodeIgniter4/incoming/routing.html#placeholders I have used it in every route of my web and it works, I also tried to write the ulr without {locale}, and still dosen't work Quote:In Routes |