routes with namespace & filter not work proper - 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: routes with namespace & filter not work proper (/showthread.php?tid=79602) |
routes with namespace & filter not work proper - [email protected] - 07-06-2021 Code: $routes->get("dashboard", "DashboardController::index", ["namespace" => "\Modules\dashboard\Controllers\Admin"], ["filter" => "auth"]); Code: $routes->get("dashboard", "DashboardController::index", ["filter" => "auth"], ["namespace" => "\Modules\dashboard\Controllers\Admin"]); RE: routes with namespace & filter not work proper - ikesela - 07-07-2021 try use kint to trace the error , d(), dd(), trace() RE: routes with namespace & filter not work proper - salain - 07-07-2021 Not 100% sure, but as far as I understand the documentation your filter and namespace options should be an array PHP Code: $routes->get("dashboard", "DashboardController::index", ["namespace" => "\Modules\dashboard\Controllers\Admin","filter" => "auth"]); RE: routes with namespace & filter not work proper - InsiteFX - 07-07-2021 The last parameter to the routes is an $options array this is an associated array to hold all options to the route, like namespace and filter [namespace => name, filter => your_filter] RE: routes with namespace & filter not work proper - [email protected] - 07-08-2021 (07-07-2021, 12:11 AM)salain Wrote: Not 100% sure, but as far as I understand the documentation your filter and namespace options should be an array Now, It's working. Thank You (07-07-2021, 01:59 AM)InsiteFX Wrote: The last parameter to the routes is an $options array this is an associated array to hold all options to the route, Now, It's working. Thank You |