re-route with optional argument. possible bug?? |
hello there,
so i was working a project and tried to make an obvious route that did not work. Example if you have a route like PHP Code: $route["admin/foos/(:num)"] = "admin/hello/$1"; PHP Code: public function hello($arg=null) { Code: is NULL 2. calling url http://localhost/<project>/admin/foos/547 is as expected Code: has 547 If I remove the route like PHP Code: // $route["admin/foos/(:num)"] = "admin/hello/$1"; the result is as expected Code: is NULL PHP Code: has 586 The workaround i found was PHP Code: $route["admin/foos/?(:num)?"] = "admin/hello/$1";
Harpreet Bhatia
Web Developer / Analyst Technical Reviewer - "Codeigniter 2 Cookbook" |
Welcome Guest, Not a member yet? Register Sign In |