![]() |
when I set routes with add and post, It's not work - 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: when I set routes with add and post, It's not work (/showthread.php?tid=80051) |
when I set routes with add and post, It's not work - asrahi - 09-07-2021 Hi! I was setting $routes like this, But it's not work I expected, if I connect "test.com/board" then call Board:list and I try to submit form POST in "test.com/board", as I know it's call Board ![]() I was trying to modify my code to priority, as, and something else... but it's not work too filnaly I figure out, if Im trying to use "get" instead of "add", then It's work.. ![]() I couldn't understand well plz tell me this problem Thank you PHP Code: $routes->group('board',function($routes){ RE: when I set routes with add and post, It's not work - ikesela - 09-07-2021 better use 'get' instead 'add' , so router know what to do, not guessing what to do using 'add' * from CI documentation: it is recommended to always use the HTTP-verb-based routes RE: when I set routes with add and post, It's not work - kilishan - 09-07-2021 Using `add` will make the route available across ALL verbs (get, post, etc). It is always better to specify the exact verb you want used so that there's no unintended actions happening when a different verb gets used. While there's a very small chance that could form a security issue, it does cause issues like you were just seeing, also. RE: when I set routes with add and post, It's not work - asrahi - 09-09-2021 (09-07-2021, 12:48 PM)ikesela Wrote: better use 'get' instead 'add' , so router know what to do, not guessing what to do using 'add' Thank you! I'll use 'get' Actually I can't understand well documentation, bcz I can't speak english well ;( (09-07-2021, 12:58 PM)kilishan Wrote: Using `add` will make the route available across ALL verbs (get, post, etc). It is always better to specify the exact verb you want used so that there's no unintended actions happening when a different verb gets used. While there's a very small chance that could form a security issue, it does cause issues like you were just seeing, also. Thank you! I wonder, why the 'post' (written explicitly) can't has priority? even I set attribute of priority RE: when I set routes with add and post, It's not work - InsiteFX - 09-10-2021 If your using chrome or any new web browser most have a language translation built in now. |