CodeIgniter Forums
can a controller with index() have further characters in the URI? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: can a controller with index() have further characters in the URI? (/showthread.php?tid=28159)



can a controller with index() have further characters in the URI? - El Forum - 03-03-2010

[eluser]Samuurai[/eluser]
Hi,

I need my index() function in my contract controller to answer the following url:

www.domain.com/contract/15

15 being the contract ID.

This works with non index() functions.


can a controller with index() have further characters in the URI? - El Forum - 03-03-2010

[eluser]mohsin917[/eluser]
use it like index function parameter index($x = 0)

and change you link to www.domain.com/contract/index/15


here the index is the function name, 15 is your input item.


can a controller with index() have further characters in the URI? - El Forum - 03-03-2010

[eluser]Samuurai[/eluser]
Brilliant.. makes perfect sense!