Welcome Guest, Not a member yet? Register   Sign In
Use controller as input parameter
#1

[eluser]Unknown[/eluser]
Hi,
I'm new to CI and have been exploring it regularly. I came across this problem while creating a sample program:

CI URL: http://domain.com/controller/class/arguments

What if I want to use the controller as an input parameter instead of using the above?

Eg: http://domain.com/arguments
http://domain.com/jack123

Please help me with this. Thanks in advance.
#2

[eluser]Eduard Stankovic[/eluser]
edit your application/config/routes.php file and add something like this
Code:
$routes['(:any)'] = 'controller/method/$1';

but it doesn't work for more controllers.
#3

[eluser]Unknown[/eluser]
Nice! I fixed it for my site! .thank you
-----------------------------------------------------------------
[URL="http://memoryzone.com.vn"]memoryzone[/URL]
#4

[eluser]greedyman[/eluser]
[quote author="shubhodeep" date="1362043963"]Hi,
I'm new to CI and have been exploring it regularly. I came across this problem while creating a sample program:

CI URL: http://domain.com/controller/class/arguments

What if I want to use the controller as an input parameter instead of using the above?

Eg: http://domain.com/arguments
http://domain.com/jack123

Please help me with this. Thanks in advance.[/quote]

You can use "segment" to take controller from url, and you can use it to do something. And arguments is not controller as example you gave, it's only parameter.




Theme © iAndrew 2016 - Forum software by © MyBB