Use :any wildcard two times -CI route Help |
Hello..
I have building multi language support website..I need to hide controller name..(because it will hard to convert controller name when language change ) My Route Code $route['(\w{2})/(:any)'] = 'page/view/$1'; $route['(\w{2})/(:any)/(:any)'] = 'page/view/$1/$2'; $route['(\w{2})/(:any)/(:any)/(:any)'] = 'page/view/$1/$2'; $route['(\w{2})/(:any)'] = 'catalogue/view/$1'; $route['(\w{2})/(:any)/(:any)'] = 'catalogue/view/$1/$2'; $route['(\w{2})/(:any)/(:any)/(:any)'] = 'catalogue/view/$1/$2'; $route['(\w{2})/(:any)/(:any)/(:any)/(:any)'] = 'catalogue/view/$1/$2/$3'; $route['(\w{2})/(.*)'] = '$2'; $route['(\w{2})'] = $route['default_controller']; Problem :- Only one controller method work..actually catalogue controller method work.Page controller get catalogue values ![]() ![]() Reason:- You can't use two :any method in same route php file ![]() Anyway to solve this problem? Idea:- Telling page controller to avoid taking catalogue controller values ![]() I hope i explain my problem..please guys help me ![]()
You can not use (:any) that way, it is a catch all route and needs to be the last route called.
See the Users Guide on Routes. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Yes i understand :any need to be add after all routes
![]() Do u know any way to translate page,catalogue controller names ? |
Welcome Guest, Not a member yet? Register Sign In |