I have problems with routing and I just can't figure out what is wrong.
When I need to take parameter from URI I just can't make my route works.
So this is what I have in route.php
$routes->add('admin', 'Admin/Login::index');
$routes->add('admin/login', 'Admin/Login::login');
$routes->add('admin/gUP', 'Admin/AdminGlavni::g_obrada');
$routes->add('admin/cam', 'Admin/AdminGlavni::cam_prikaz');
$routes->add('admin/cam/edit/(:any)', 'Admin/AdminGlavni::cam_edit_show/$1');
but this is not working (all other routes works as they should)
$routes->add('admin/cam/edit/(:any)', 'Admin/AdminGlavni::cam_edit_show/$1');
When I try to reach mydmain.com/admin/cam/edit/1 I get:
404 - File Not Found
Controller or its method is not found: \App\Controllers\Admin::index
and cam_edit_show in AdminGlavni Class is defined like this:
public function cam_edit_show($id) {
......
}
What is wrong whit my route? Please help.
FOUND ANSWER:
Slash in handler was wrong. It supposed to be \ and not /