DIFINING A ROUTE |
I would like to know which one is the best practice to define a route in CodeIgniter 4:
PHP Code: $routes->post('registration', [ApiVendorAuthController::class, 'registerVendor']);
Learning Codeigniter
CodeIgniter 4 User Guide - URI Routing - Assigning Namespace
I only add the namespace on my Routes that are in a Routes Group. The first one will prepend the namespace, where the second one only applies it to the method. The above link will explain it for you. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(02-27-2024, 03:33 AM)InsiteFX Wrote: CodeIgniter 4 User Guide - URI Routing - Assigning Namespace Thank you for the reply, I want to know which is the best way?
Learning Codeigniter
It is up to you, but I use the first one on regular Routes and the second one on my Route Groups.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |