routing and subfolder problem |
[eluser]easymind[/eluser]
I have: Code: in: controllers/ttt So somehow the position of the arguments to the subfoldered function are not routed correctly, or I need to use a different syntax. What is the problem here? Code: $route["english/(:any)"] = "$1"; I even noticed that putting folders inside a folder in your controller (so if you go 2 deep) you always get a 404 without routing...
[eluser]easymind[/eluser]
Ok, I have found this fix in the bug reports: Proposed fix (only for the current svn version): 1- In URI.php (this is now in Router.php) change the snippet of code in _reindex_segments() to accurately compare the 2 segment arrays from : $diff = (count(array_diff($this->rsegments, $this->segments)) == 0) ? FALSE : TRUE; to: $diff = (count(array_diff($this->segments, $this->rsegments)) == 0) ? FALSE : TRUE; 2- In system/codeigniter/CodeIgniter.php, change the snippet of code that slice $rsegments to find the request’s arguments. Whether the controller is in a subdirectory or not, $rsegments will no longer have that information and should be treated the same regardless. From: call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, (($RTR->fetch_directory() == ‘’) ? 2 : 3))); To: call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2)); (now $URI->rsegments needs to be $this->rsegements) (bold additions is for version 1.5.4) I am glad I can do my languages thing now. But CI still doesn't let you go 2 or more deep inside your controller map. Original bug fix.: http://codeigniter.com/bug_tracker/bug/2849/ |
Welcome Guest, Not a member yet? Register Sign In |