parameter before controller name |
[eluser]Unknown[/eluser]
Hi Guys ,,, How are you all ? first of all , I'm sorry for weak English I want to pass a parameter before Controller name , and i search hours and hours and i didn't find a solution normal URL: http://sitename/index.php/controllername...nname/par1 what I want : http://sitename/index.php/HERE/controllername/functionname/par1 So, If any one can help me ?
[eluser]leet_2k[/eluser]
Hi ayyad1990, Go to: applications/config/routes.php Put the following under URI ROUTING: $route['(:any)/controllername/function'] = "controllername/function"; What you are telling in the line above is anything before a controllername send it to controllername CONTROLLER . Hope that helps.
[eluser]Unknown[/eluser]
[quote author="leet_2k" date="1354653364"]Hi ayyad1990, Go to: applications/config/routes.php Put the following under URI ROUTING: $route['(:any)/controllername/function'] = "controllername/function"; What you are telling in the line above is anything before a controllername send it to controllername CONTROLLER . Hope that helps. [/quote] thanks , But I have many and many of controllers , this way is not sufficent !!!
[eluser]CroNiX[/eluser]
Well, you want to go against the default behavior of codeigniter, so it will involve a not so easy solution. CI provides the routes to allow you to do what you are wanting to do (bypass default behavior). |
Welcome Guest, Not a member yet? Register Sign In |