In this video of CodeIgniter 4 From Scratch Series we will see how we can manage our routes. We will take a look at Routes.php file that holds our navigation logic.
Quick overview of what to expect in this video:
– How to manage our routes
– How to define custom routes
– How to create a group of route
– How to add a route based on the HTTP request type
CodeIgniter 4 From Scratch Series, the series that are intended to help you get started with CodeIgniter 4 even if you have never worked with PHP frameworks before.
This course will not only help you get started with CodeIgniter but also will help you understand the way PHP Frameworks work.
For more information about Codeigniter 4 Routing read the official docs
–
Nguồn: https://rmacct.org/
Xem thêm bài viết khác: https://rmacct.org/cong-nghe/
Xem thêm Bài Viết:
- Đánh giá nhanh bo mạch chủ ASROCK X470 TAICHI ULTIMATE
- Cách tắt ứng dụng chạy ngầm android samsung, oppo, xiaomi, realme
- Không thể phá khối EXPLODE được Block trong autocad // Lệnh X (xplode) // Mẹo vặt autocad
- The RX 580 Is Still An AMAZING GPU For Mining Today!
- Gigabyte RX 580 Aorus 8GB 256 bits GDDR5 đánh giá tổng thể và test 6 game 4k & full HD
Hi bro, please look at this problem I have …
When I use placeholer in the routes for sub-folder it doesn't work:
$routes->get('cerrar-jornada/(:any)', 'admin/Jornada::cerrarJornada/$1');
respond with>>>//404 – File Not Found
//Controller or its method is not found: AppControllersadmin::index
this work:
$routes->get('cerrar-jornada', 'admin/Jornada::cerrarJornada');
I got the problem with default value of function:
– My controller:
public function teaching($subject = "CI4") {
return "I am teaching : " . $subject;
}
– My routes
$routes->add('teach/(:any)', 'Teacher::teaching/$1')
It fine if I pass the parameter localhost:8080/teach/ci4
but it will error when i don't pass the parameter localhost:8080/teach
Great video, everything well explained. Thanks
Nice tutorial Alex! But do we have to add routes for every method that we have?
Hi Alex, after I submitted the post form it displays object not found. I'm stuck here. can you help me?
thanks Alex …. so what the diffirent between add and get in the route file
Will you talk about multilingual apps in the future? I wonder what is the proper way of routing that in CodeIgniter 4.
Hi, Alex great tutorial. One question regarding controllers. You seem to be creating controllers by duplicating default one and that uses AppControllersBaseController, in the docs however they tell you to create controller using AppControllersController what is the difference if any?