CodeIgniter Forums
[RESOLVED] Segments not being passed to controller in subdir!!!! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: [RESOLVED] Segments not being passed to controller in subdir!!!! (/thread-1863.html)



[RESOLVED] Segments not being passed to controller in subdir!!!! - El Forum - 07-01-2007

[eluser]the real rlee[/eluser]
Guys, serious problem here, desperate for some help. For some reason routed segments are not being passed to sub controller functions. (FYI regex is valid and tested)

Routes:
Code:
$route['about\/locations(?:\/([a-zA-Z]{3}))?(?:\/([a-zA-Z-]+))?'] = "about/locations/index/$1/$2";

Locations Controller:
Code:
function index($state, $storename) {

   echo $state; // prints what should be storename!
}

Help greatly appreciated!


[RESOLVED] Segments not being passed to controller in subdir!!!! - El Forum - 07-01-2007

[eluser]the real rlee[/eluser]
Ok, seems that my captures wern't working, needed extra parenthesis. Also, seems the slashes dont need to be escaped in CI either:

Code:
$route['about/locations(?:/([a-zA-Z]{3}))?(?:/([a-zA-Z-]+))?'] = "about/locations/index/$1/$2";