CodeIgniter Forums
Can this work? index($myvar) - 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 this work? index($myvar) (/showthread.php?tid=12673)



Can this work? index($myvar) - El Forum - 10-27-2008

[eluser]tmac[/eluser]
Hi, I have a question about the index function within a controller.
I know that if I use http://www.mysite.com/page/index/myvar it would work, but how do I get rid of the "index"

Thanks for any info on this Smile


Can this work? index($myvar) - El Forum - 10-27-2008

[eluser]pistolPete[/eluser]
You can use the _remap()-function:

Documentation

Code:
function _remap($myvar)
{
    $this->index(myvar);
}