![]() |
pass parameter to index function - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: pass parameter to index function (/showthread.php?tid=26990) |
pass parameter to index function - El Forum - 01-28-2010 [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! pass parameter to index function - El Forum - 01-28-2010 [eluser]danmontgomery[/eluser] [quote author="searain" date="1264735651"]is ..../somecontroller/index/1, ..../somecontroller/index/2?[/quote] Yep pass parameter to index function - El Forum - 01-28-2010 [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. pass parameter to index function - El Forum - 02-19-2010 [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: /** |