I need some help I wanna pass this parameter to a Controller |
I wanna pass this parameter to a Controller in CI, for instance {Controller}/{View}/{Params} , where {Params} I need it to be like code1+code2+code3 , is this possible ?
for instance : Players/GetPlayersInfoByIdList/id1+id2+id3 or there is a better way to do it ?
Can you not do it exactly as you have it and then explode it out when you get it into your controller?
Actually, a little more detail on what you are doing may be helpful. R
I've not had to do it, so I haven't checked it out, but from the documentation it seems that you can have any or at least some number of additional URL segments, which will be interpreted just like the third. That is...
Code: http://www.example.com/controller/method/arg1/arg2/.../argn Presumably then, your method would expect those arguments, with Code: function foo ($arg1, $arg2, $arg3='', $argn=false) If it doesn't work that way, you should still be able to receive the set of arguments as a single argument, which as russ_kern pointed out, you can put into an array with the explode statement.
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!
Passing the variables as one string with seperators is a good idea, but there's another way:
PHP Code: function test($name){ See CI's documentation: http://www.codeigniter.com/userguide3/li...i_to_assoc |
Welcome Guest, Not a member yet? Register Sign In |