Welcome Guest, Not a member yet? Register   Sign In
Why does routing fail?
#1
Smile 

Hi. Smile

## overview
I'm trying to make `$ routes-> get` and` $ routes-> post` on the update screen, but the routing that receives the id doesn't work.
Especially the second post method output "` Undefined array key 0`
https://drive.google.com/file/d/1QnEnUe9...p=drivesdk

What may be the cause?
Commenting out `$ routes-> post` will display the get method successfully.

## reference
https://ci-trans-jp.gitlab.io/user_guide...uting.html

PHP Code:
$routes->get('school/certification/edit/(:num)''SchoolCertificationController::editGet/$1', ['as' => 'certification_edit_get']);
// TODO: For some reason I get an Undefined array key 0 when I add this
$routes->post('school/certification/edit/(:num)''SchoolCertificationController::editPost/$1', ['as' => 'certification_edit_post']); 
Reply
#2

It seems no problem in your route definitions.
Did you send post request to the URL like http://localhost/school/certification/edit/1 ?

But I recommend you to read the latest official user guide.
https://codeigniter4.github.io/userguide/
Your reference is too old, and not the official.
Reply
#3

(03-26-2022, 03:28 AM)kenjis Wrote: It seems no problem in your route definitions.
Did you send post request to the URL like http://localhost/school/certification/edit/1 ?

But I recommend you to read the latest official user guide.
https://codeigniter4.github.io/userguide/
Your reference is too old, and not the official.
thanks, kenjis Smile
I will read new document.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB