can you show me how match routes dont work in this case> - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: can you show me how match routes dont work in this case> (/showthread.php?tid=91317) |
can you show me how match routes dont work in this case> - startup - 07-19-2024 today i test matches routes in codeigniter 4.5.3 but it don't work, someone can show me? routes PHP Code: $routes->match(['get','post'],'vnadmin/camera_category/addCate','\Modules\Admin\Cam\Controllers\CamController::addCate'); controller PHP Code: public function addCate(){ view PHP Code: <form class="form-horizontal" role="form" name ="form1" id="form1" method="post" action="<?php echo $Method; ?>" enctype="multipart/form-data" > this code can go to page addCate but it dont get post data RE: can you show me how match routes dont work in this case> - kenjis - 07-19-2024 See https://codeigniter.com/user_guide/incoming/routing.html#http-verb-routes and https://codeigniter.com/user_guide/incoming/routing.html#confirming-routes RE: can you show me how match routes dont work in this case> - kenjis - 07-19-2024 This code is wrong. PHP Code: if($this->request->getMethod() == "post"){ See https://codeigniter.com/user_guide/installation/upgrade_450.html#upgrade-450-lowercase-http-method-name Using is() might be better. https://codeigniter.com/user_guide/incoming/incomingrequest.html#is RE: can you show me how match routes dont work in this case> - ozornick - 07-19-2024 Using constant Method::POST Method::GET https://github.com/codeigniter4/CodeIgniter4/blob/c23ff44cd17887b53864a855e129b98c65dd00b3/system/HTTP/Method.php#L46 RE: can you show me how match routes dont work in this case> - startup - 07-19-2024 thank you https://forum.codeigniter.com/member.php?action=profile&uid=52428 and https://forum.codeigniter.com/member.php?action=profile&uid=90 add is('post') work for me |