• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
parameter before controller name

#1
[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/functionname/par1

what I want :
http://sitename/index.php/HERE/controllername/functionname/par1

So, If any one can help me ?


#2
[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.

#3
[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 !!!


#4
[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).


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.