pass parameter to index function |
[eluser]searain[/eluser]
http://ellislab.com/forums/viewthread/94028/ How to pass parameter to index function? I found the above thread. So the default way in the codeigniter to pass the parameter to index function is ..../somecontroller/index/1, ..../somecontroller/index/2? If that is the default way, I would use it instead of make set up or configuration changes. Thanks!
[eluser]danmontgomery[/eluser]
[quote author="searain" date="1264735651"]is ..../somecontroller/index/1, ..../somecontroller/index/2?[/quote] Yep
[eluser]pistolPete[/eluser]
You could also use the _remap() function, e.g.: Code: function _remap($method) Then you would use ..../somecontroller/1 without the index parameter.
[eluser]wasil[/eluser]
hi all, i wanted to use dash-separated URIs even for 'method' segment. Saiful's solution gave me an inspiration, but i wanted something more universal. here is set of two methods ( method itself is called from the separated _call method since i use it for other remapping purposes ). i'll appretiate any improvement hints. Code: /** |
Welcome Guest, Not a member yet? Register Sign In |